Commit 7c71df34 authored by mw4ll4c3's avatar mw4ll4c3 Committed by bgm

Issue #1907276 by mw4ll4c3: Issue with php version - Only variables should be...

Issue #1907276 by mw4ll4c3: Issue with php version - Only variables should be passed by reference in boost.module
parent 78610362
......@@ -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));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment