Skip to content

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

@ChefAndy

Description

@ChefAndy

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions