Skip to content
Snippets Groups Projects
Commit c4b55279 authored by Ben Coburn's avatar Ben Coburn
Browse files

fix config plugin setting_numeric pattern

The old pattern (left as a comment) allowed many PHP syntax errors
to be inserted into local.php for numeric values. This was breaking
the wiki... see bug #769.

This patch should eliminate the syntax errors by using a more restrictive
definition of numeric settings.

darcs-hash:20060327200700-05dcb-ccb8d532e5c123965fc6c8e79fb49c93170d827e.gz
parent 17e7a281
No related branches found
No related tags found
No related merge requests found
......@@ -458,7 +458,11 @@ if (!class_exists('setting_email')) {
if (!class_exists('setting_numeric')) {
class setting_numeric extends setting_string {
var $_pattern = '/^[-+\/*0-9 ]*$/';
// This allows for many PHP syntax errors...
// var $_pattern = '/^[-+\/*0-9 ]*$/';
// much more restrictive, but should eliminate syntax errors.
var $_pattern = '/^[-]?[0-9]+(?:[-+*][0-9]+)*$/';
//FIXME - make the numeric error checking better.
function out($var, $fmt='php') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment