Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows creating theme with illegal class name. Enabling theme crashes whole instance. #79

Open
ChefAndy opened this issue Apr 10, 2023 · 0 comments

Comments

@ChefAndy
Copy link

ChefAndy commented Apr 10, 2023

Howdy friends. The CLI will create a theme that has a name starting with a number even though it directly uses that value as a class name. Enabling the theme dumps the whole instance with a parse error.

<?php
namespace Grav\Theme;
 
use Grav\Common\Theme;
 
class 2numeric4grav extends Theme
{
    // Access plugin events in this class
}
 

Arguments

    "syntax error, unexpected integer "2", expecting identifier"

I imagine this is pretty low priority, but also seems like a trivial addition to your existing validation check... but I only skimmed it!

(If anyone lands here investigating how to restore your crashed instance after enabling a theme with an illegal name, just go into the grav's system.yaml and swap out any references to the bad theme name with another valid theme and you'll be good to go.)

@ChefAndy ChefAndy changed the title Allows creating theme with illegal class name. Enabling theme crashes whole app. Allows creating theme with illegal class name. Enabling theme crashes whole instance. Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant