MDL-15897: Changed admin_setting_configtext.validate() check to not treat all strings as custom regex's (since PARAM_* constants are now strings).
Instead require them to have '/' at the beginning and end of the pattern. The only setting that appears to use a custom regex is scorm/apidebugmask - now updated to contain surrounding slashes.
This commit is contained in:
+2
-1
@@ -1508,7 +1508,8 @@ class admin_setting_configtext extends admin_setting {
|
||||
* @return mixed true if ok string if error found
|
||||
*/
|
||||
public function validate($data) {
|
||||
if (is_string($this->paramtype)) {
|
||||
// allow paramtype to be a custom regex if it is the form of /pattern/
|
||||
if (preg_match('#^/.*/$#', $this->paramtype)) {
|
||||
if (preg_match($this->paramtype, $data)) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user