Merge branch 'MDL-58761_bad_regex_in_custom_step' of https://github.com/gthomas2/moodle

This commit is contained in:
Dan Poltawski 2017-07-25 11:06:27 +01:00
commit 7de5101d4e

View File

@ -539,7 +539,7 @@ class behat_navigation extends behat_base {
$bodynode = $this->find('xpath', 'body');
$bodyclass = $bodynode->getAttribute('class');
$matches = [];
if (preg_match('/(?<=^course-|\scourse-)\d/', $bodyclass, $matches) && !empty($matches)) {
if (preg_match('/(?<=^course-|\scourse-)\d+/', $bodyclass, $matches) && !empty($matches)) {
$courseid = intval($matches[0]);
} else {
$courseid = SITEID;