diff --git a/lib/rtlcss/RTLCSS.php b/lib/rtlcss/RTLCSS.php
index 42773c0ea42..1e14e805e2f 100644
--- a/lib/rtlcss/RTLCSS.php
+++ b/lib/rtlcss/RTLCSS.php
@@ -270,17 +270,19 @@ class RTLCSS {
$groups = [$value];
}
foreach ($groups as $group) {
- $values = $group->getListComponents();
- switch (count($values)) {
- case 2:
- $group->setListComponents(array_reverse($values));
- break;
- case 3:
- $group->setListComponents([$values[1], $values[0], $values[1], $values[2]]);
- break;
- case 4:
- $group->setListComponents([$values[1], $values[0], $values[3], $values[2]]);
- break;
+ if ($group instanceof RuleValueList) {
+ $values = $group->getListComponents();
+ switch (count($values)) {
+ case 2:
+ $group->setListComponents(array_reverse($values));
+ break;
+ case 3:
+ $group->setListComponents([$values[1], $values[0], $values[1], $values[2]]);
+ break;
+ case 4:
+ $group->setListComponents([$values[1], $values[0], $values[3], $values[2]]);
+ break;
+ }
}
}
}
@@ -354,7 +356,7 @@ class RTLCSS {
$value = $parts[0];
// The first value may be referencing top or bottom (y instead of x).
- if (!is_object($value) && preg_match('/top|bottom/i', $value)) {
+ if (!is_object($value) && preg_match('/top|bottom/i', $value) && count($parts)>1) {
$value = $parts[1];
}
diff --git a/lib/rtlcss/moodle_readme.txt b/lib/rtlcss/moodle_readme.txt
index 3c00f5f3397..a1ae1dcbbb4 100644
--- a/lib/rtlcss/moodle_readme.txt
+++ b/lib/rtlcss/moodle_readme.txt
@@ -1,8 +1,6 @@
RTLCSS
------
-Import git ref: v1.0.0
-
Downloaded from: https://github.com/moodlehq/rtlcss-php
Import procedure:
diff --git a/lib/thirdpartylibs.xml b/lib/thirdpartylibs.xml
index edc51c83d28..34a448a86e8 100644
--- a/lib/thirdpartylibs.xml
+++ b/lib/thirdpartylibs.xml
@@ -230,7 +230,7 @@
rtlcss
RTLCSS for PHP
MIT
- 1.0.0
+ 1.0.1
scssphp