-
Notifications
You must be signed in to change notification settings - Fork 88
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
Adding slashes at the end of plugin name on 'plugin-tests' subcomand generates corrupted bootstrap.php #133
Comments
I noticed that in general the not strict syntax check of slug afflict almost all subcommands. For example:
Maybe another (and better) approach could be to check allowed slug characters like only |
What do you think about hard-erroring instead? I'm not sure it makes sense to magically transform user input in this case; probably better to inform the user they've provided invalid input (as we've done in #26) |
@danielbachhuber I agree. As I previously wrote, in fact, I worked also on another branch that issues a The only thing to do is to add (where missing) or fix correct regexes for each slug checking.
returning a generic error: "Error: Couldn't create theme (received 500 response)." In reality, the web interface, even if it returns 500, says also "Theme slug could not be used to generate valid function names. Please go back and try again.".
unzip I'm doing same kind of analysis for all others scaffold commands. |
Sounds good! I'll defer to your judgement on what changes make sense. |
Adding one or more slashes at the end of plugin name like for example:
runs right, but causes the creation of a corrupted bootstrap.php file that produces a PHP Fatal error on
require()
that file when launching tests.(The usual message is like following: "PHP Fatal error: require(): Failed opening required '/path/to/my-plugin/.php' (include_path='.') in /path/to/my-plugin/tests/bootstrap.php on line 26.")
I'd like to send a PR in order to fix this for example by right trimming slashes to
$slug
before to send to mustache template.The text was updated successfully, but these errors were encountered: