summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormw4ll4c32014-12-17 05:21:05 (GMT)
committerMathieu Lutfy2014-12-17 05:21:05 (GMT)
commit7c71df34da24097256877488d1220d75089a27eb (patch)
tree05cd9efb7765459d6c29a553d2ba010d7bd0d808
parent78610362805bfb5edc213708bbbb02b14c583ebd (diff)
Issue #1907276 by mw4ll4c3: Issue with php version - Only variables should be passed by reference in boost.module6.x-1.226.x-1.x
-rw-r--r--boost.module25
1 files changed, 20 insertions, 5 deletions
diff --git a/boost.module b/boost.module
index 2705802..4dbe19b 100644
--- a/boost.module
+++ b/boost.module
@@ -2628,9 +2628,15 @@ function _boost_ob_handler() {
function boost_get_content_type() {
$headers = explode("content-type: ", strtolower(drupal_get_headers()));
$types = array();
+
foreach ($headers as $header) {
- $types[] = array_shift(explode('; charset=', array_shift(explode('\n', $header))));
+ if (! empty($header)) {
+ list($header_first_line) = explode('\n', $header);
+ list($header_first_part) = explode('; charset=', $header_first_line);
+ $types[] = $header_first_part;
+ }
}
+
return array_filter($types);
}
@@ -4686,9 +4692,13 @@ function boost_cache_css_js_files($buffer) {
array_shift($css_files);
foreach ($css_files as $key => $value) {
// Extract css filename
- $temp = explode(base_path(), array_pop(explode('//', array_pop(explode('href="', array_shift(explode('" />', $value)))))));
+ list($temp) = explode('" />', $value);
+ $temp = explode('href="', $temp);
+ $temp = explode('//', array_pop($temp));
+ $temp = explode(base_path(), array_pop($temp));
array_shift($temp);
- $css_files[$key] = array_shift(explode('"', array_shift(explode('?', implode('/', $temp)))));
+ list($temp) = explode('?', implode('/', $temp));
+ list($css_files[$key]) = explode('"', $temp);
}
_boost_copy_css_files($css_files);
}
@@ -4697,9 +4707,14 @@ function boost_cache_css_js_files($buffer) {
array_shift($js_files);
foreach ($js_files as $key => $value) {
// Extract javascript src filename; kill scripts with no src tag
- $temp = explode(base_path(), array_pop(explode('//', array_pop(explode('src="', array_shift(explode('">', $value)))))));
+ list($temp) = explode('">', $value);
+ $temp = explode('src="', $temp);
+ $temp = explode('//', array_pop($temp));
+ $temp = explode(base_path(), array_pop($temp));
array_shift($temp);
- $js_files[$key] = array_shift(explode('type=', array_shift(explode('"', array_shift(explode('?', implode('/', $temp)))))));
+ list($temp) = explode('?', implode('/', $temp));
+ list($temp) = explode('"', $temp);
+ list($js_files[$key]) = explode('type=', $temp);
}
_boost_copy_js_files(array_filter($js_files));
}