From b15004b28faeecebc74e0b15ab56b87f38b00746 Mon Sep 17 00:00:00 2001 From: vChabot Date: Wed, 9 May 2012 13:30:12 +0000 Subject: [PATCH] [-] FO : BugFix : #PSCFV-2243 : CCC optimization on scripts compile each script two times --- classes/controller/Controller.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/controller/Controller.php b/classes/controller/Controller.php index 9aea99c59..494167fad 100644 --- a/classes/controller/Controller.php +++ b/classes/controller/Controller.php @@ -240,13 +240,13 @@ abstract class ControllerCore if (is_string($css_file) && strlen($css_file) > 1) { $css_path = Media::getCSSPath($css_file, $media); - if ($css_path) + if ($css_path && !in_array($css_path, $this->css_files)) $this->css_files = array_merge($this->css_files, $css_path); } else { $css_path = Media::getCSSPath($media, $css_media_type); - if ($css_path) + if ($css_path && !in_array($css_path, $this->css_files)) $this->css_files = array_merge($this->css_files, $css_path); } } @@ -270,14 +270,14 @@ abstract class ControllerCore foreach ($js_uri as $js_file) { $js_path = Media::getJSPath($js_file); - if ($js_path) + if ($js_path && !in_array($js_path, $this->js_files)) $this->js_files[] = $js_path; } else { $js_path = Media::getJSPath($js_uri); - if ($js_path) - $this->js_files[] = $js_path; + if ($js_path) + $this->js_files[] = $js_path; } }