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.
* @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 {
$settings->add(new admin_setting_configcheckbox('scorm/allowapidebug', get_string('allowapidebug', 'scorm'), '', 0));
-$settings->add(new admin_setting_configtext('scorm/apidebugmask', get_string('apidebugmask', 'scorm'), '', '.*'));
+$settings->add(new admin_setting_configtext('scorm/apidebugmask', get_string('apidebugmask', 'scorm'), '', '/.*/'));
-?>
\ No newline at end of file
+?>