Permalink
Browse files

MDL-38075 csslib: fixed coding error when working with an array of st…

…yles
  • Loading branch information...
1 parent bbcf8da commit fe0ce218406a8617d309873a396e91afd12efa2a Sam Hemelryk committed Feb 17, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/csslib.php
View
@@ -1745,7 +1745,13 @@ public function get_error_string() {
$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();
}
}

0 comments on commit fe0ce21

Please sign in to comment.