From fd6d738db4cbaf817e670c7f140ac66c10f77059 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Mon, 18 Feb 2013 08:21:43 +1300 Subject: [PATCH] MDL-38075 csslib: fixed coding error when working with an array of styles --- lib/csslib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/csslib.php b/lib/csslib.php index 548f854adac..95f99abd7fc 100644 --- a/lib/csslib.php +++ b/lib/csslib.php @@ -1747,7 +1747,13 @@ class css_rule { $css = $this->out(); $errors = array(); foreach ($this->styles as $style) { - if ($style->has_error()) { + if (is_array($style)) { + foreach ($style as $s) { + if ($style instanceof css_style && $style->has_error()) { + $errors[] = " * ".$style->get_last_error(); + } + } + } else if ($style instanceof css_style && $style->has_error()) { $errors[] = " * ".$style->get_last_error(); } }