From 34a716226ee83f5103e30abd72cf70d1c6000d62 Mon Sep 17 00:00:00 2001 From: Peter Burnett Date: Tue, 27 Jul 2021 15:11:59 +1000 Subject: [PATCH] Raised time limit for page generation --- .../controllers/maintenance_static_page_generator.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/local/controllers/maintenance_static_page_generator.php b/classes/local/controllers/maintenance_static_page_generator.php index 2493b2f..fe23863 100644 --- a/classes/local/controllers/maintenance_static_page_generator.php +++ b/classes/local/controllers/maintenance_static_page_generator.php @@ -27,6 +27,7 @@ namespace auth_outage\local\controllers; use auth_outage\local\outagelib; use coding_exception; +use core_php_time_limit; use DOMDocument; use DOMElement; use invalid_state_exception; @@ -84,6 +85,10 @@ class maintenance_static_page_generator { $this->io->cleanup(); if (!is_null($this->dom)) { + + // This can take a while to process using repeated curls. + core_php_time_limit::raise(); + $this->io->create_resources_path(); $this->remove_script_tags(); @@ -246,7 +251,7 @@ class maintenance_static_page_generator { private function update_inline_background_images() { global $CFG; $xpath = new \DOMXPath($this->dom); - $elements = $xpath->query("//*[@style]"); + $elements = $xpath->query("//*[contains(@style,'background')]"); foreach ($elements as $element) { $style = $element->getAttribute("style");