splitbrain / dokuwiki-plugin-bureaucracy

Create forms and generate pages or emails from them
http://www.dokuwiki.org/plugin:bureaucracy
GNU General Public License v2.0
43 stars 47 forks source link

Remove '-' from scriptNamePattern valid chars #221

Closed dregad closed 6 years ago

dregad commented 7 years ago

Since '-' is not a valid char for PHP keywords, it cannot be used in the script handler file name, as we would get an error when submitting the form (either because the class was not found, or because of a syntax error in the script).

Given a form as shown below and the corresponding test-1.php script with a class named bureaucracy_handler_test_1 (with underscore)

<form>
Action script test-1.php
submit "Test"
</form>

We get the following:

Fatal error: Uncaught Error: Class 'bureaucracy_handler_test-1' not found in /path/to/bureaucracy/helper/actionscript.php on line 36

And of course if class is named bureaucracy_handler_test-1 we get a syntax error

Parse error: syntax error, unexpected '-', expecting '{' in /path/to/conf/plugin/bureaucracy/test-1.php on line 4 
dregad commented 6 years ago

Rebased on latest master.

Let me know if anything is needed from my side to merge this simple bug fix.

dregad commented 6 years ago

I rebased the branch on top of latest master, and the change passes the new unit tests. Is there anything preventing this from being merged ?

dregad commented 6 years ago

Could you guys please merge this ?

dregad commented 6 years ago

Thank you !