mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-51015 mod_scorm: tidy up messy code, remove use of eval()
This commit is contained in:
parent
57739a72cb
commit
524aaa177a
@ -1303,7 +1303,7 @@ function scorm_get_attempt_count($userid, $scorm, $returnobjects = false, $ignor
|
||||
* @return boolean - debugging true/false
|
||||
*/
|
||||
function scorm_debugging($scorm) {
|
||||
global $CFG, $USER;
|
||||
global $USER;
|
||||
$cfgscorm = get_config('scorm');
|
||||
|
||||
if (!$cfgscorm->allowapidebug) {
|
||||
@ -1315,9 +1315,11 @@ function scorm_debugging($scorm) {
|
||||
if (!preg_match('/^[\w\s\*\.\?\+\:\_\\\]+$/', $test)) {
|
||||
return false;
|
||||
}
|
||||
$res = false;
|
||||
eval('$res = preg_match(\'/^'.$test.'/\', $identifier) ? true : false;');
|
||||
return $res;
|
||||
|
||||
if (preg_match('/^'.$test.'/', $identifier)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user