From 36b46569062119466055f99332a8638cef8bcd9f Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Tue, 25 Jan 2022 09:19:59 +0100 Subject: [PATCH 1/2] MDL-72626 lib: Upgrade RTLCSS to 1.0.1 --- lib/rtlcss/RTLCSS.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) 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]; } From 838b33b9ab80fe63ddc82c8fbec6b8e7eb278408 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Tue, 25 Jan 2022 09:20:34 +0100 Subject: [PATCH 2/2] MDL-72626 lib: Set Moodle files after RTLCSS upgrade --- lib/rtlcss/moodle_readme.txt | 2 -- lib/thirdpartylibs.xml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) 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