Commit d98119ad authored by mikeytown2's avatar mikeytown2

#807244 by halcyonCorsair: Better variable checking.

parent d3cd5644
......@@ -99,7 +99,7 @@ function boost_requirements($phase) {
}
$cache_directories = array_unique($cache_directories);
$htaccess = stristr($_SERVER["SERVER_SOFTWARE"], 'apache') ? file_get_contents(dirname($_SERVER["SCRIPT_FILENAME"]) . '/.htaccess') : FALSE;
$htaccess = (stristr($_SERVER["SERVER_SOFTWARE"], 'apache') && file_exists(dirname($_SERVER["SCRIPT_FILENAME"]) . '/.htaccess')) ? file_get_contents(dirname($_SERVER["SCRIPT_FILENAME"]) . '/.htaccess') : FALSE;
if (BOOST_CRAWL_ON_CRON) {
$crawler_response = drupal_http_request(BOOST_CRAWLER_SELF . '&test=1', array(), 'GET', NULL, 10);
$crawler_code = $crawler_response->code;
......
......@@ -2242,7 +2242,7 @@ function _boost_ob_handler() {
}
// Check for drupal messages
if (BOOST_HALT_ON_MESSAGES && $GLOBALS['_boost_message_count'] != 0) {
if (BOOST_HALT_ON_MESSAGES && isset($GLOBALS['_boost_message_count']) && $GLOBALS['_boost_message_count'] != 0) {
$GLOBALS['_boost_cache_this'] = FALSE;
if (BOOST_VERBOSE >= 3) {
watchdog('boost', 'There are <strong>Drupal messages</strong> on this page, preventing boost from caching. MESSAGES: %msg <br /> !performance', array('%msg' => $GLOBALS['_boost_message_count'], '!performance' => l(t('Turn Off Error Checking'), 'admin/settings/performance/boost')), WATCHDOG_WARNING);
......@@ -2297,7 +2297,7 @@ function _boost_ob_handler() {
}
// Remove dead items from the cache (file & db); 404 & 403
if ($filename) {
if (!empty($filename)) {
$files = array(array('filename' => $filename));
boost_cache_kill($files, TRUE);
//boost_remove_db($files);
......@@ -2335,7 +2335,7 @@ function boost_get_http_status() {
}
function boost_headers_contain($text) {
if (function_exists(headers_list)) {
if (function_exists('headers_list')) {
return stristr(implode(' ', headers_list()), $text);;
}
else {
......@@ -3300,7 +3300,7 @@ boost_gzip_test_ready();
}
if (!BOOST_NO_DATABASE) {
boost_db_prep($filename, $extension, BOOST_TIME + $expire);
boost_cache_set_node_relationships($GLOBALS['_boost_relationships']);
boost_cache_set_node_relationships(isset($GLOBALS['_boost_relationships']) ? $GLOBALS['_boost_relationships'] : array());
}
return TRUE;
}
......
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