MDL-49557 mod_scorm: optionally strip quotes.

This commit is contained in:
Dan Marsden 2017-01-04 15:43:46 +13:00
parent 39eee56fa6
commit e68cdceee3

View File

@ -251,8 +251,12 @@ function scorm_parse_aicc(&$scorm) {
$regexp = scorm_forge_cols_regexp($columns->columns, '(.+),');
for ($i = 1; $i < count($rows); $i++) {
if (preg_match($regexp, $rows[$i], $matches)) {
$elementid = substr(trim($matches[$columns->mastercol + 1]), 1, -1);
$prereq = substr(trim($matches[2 - $columns->mastercol]), 1, -1);
$elementid = trim($matches[$columns->mastercol + 1]);
$elementid = trim(trim($elementid, '"'), "'"); // Remove any quotes.
$prereq = trim($matches[2 - $columns->mastercol]);
$prereq = trim(trim($prereq, '"'), "'"); // Remove any quotes.
$courses[$courseid]->elements[$elementid]->prerequisites = $prereq;
}
}