From 061a39ac5de19688ac14c90eb09e6956ba1fdd77 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Wed, 30 Nov 2016 12:19:03 +0800 Subject: [PATCH] MDL-57127 output: Increase memory limit when parsing CSS --- lib/outputlib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/outputlib.php b/lib/outputlib.php index 1f93bd253db..02d5bb740ca 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -1573,6 +1573,10 @@ class theme_config { $treeprocessor = $this->get_css_tree_post_processor(); $needsparsing = !empty($treeprocessor) || !empty($this->rtlmode); if ($needsparsing) { + + // We might need more memory to do this, so let's play safe. + raise_memory_limit(MEMORY_EXTRA); + $parser = new core_cssparser($css); $csstree = $parser->parse(); unset($parser);