includes/functions.php
changeset 1328 2a5845ef8c1d
parent 1322 8496dd47b87c
child 1339 03c5b9e8e02a
equal deleted inserted replaced
1327:e8f4dea267c8 1328:2a5845ef8c1d
  3237 	if ( strstr($errstr, "It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier.") )
  3237 	if ( strstr($errstr, "It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier.") )
  3238 	{
  3238 	{
  3239 		return true;
  3239 		return true;
  3240 	}
  3240 	}
  3241 	
  3241 	
       
  3242 	// nice little security enhancement
       
  3243 	$errfile = str_replace(ENANO_ROOT, '[root]', $errfile);
       
  3244 	
       
  3245 	// DBAL errors have a different type of debug
       
  3246 	if ( preg_match('/^\[root\]\/(repo\/)?includes\/dbal\.php$/', $errfile) && defined('ENANO_DEBUG') )
       
  3247 	{
       
  3248 		echo "<h1>DBAL $error_type</h1>";
       
  3249 		echo "<p>A(n) $error_type was just thrown by the database abstraction layer. $errstr</p>";
       
  3250 		echo "<p>Ensure that you are calling \$db->free_result() on all SELECT queries, <u>especially</u> unbuffered ones.</p>";
       
  3251 		echo "<p>Undefine ENANO_DEBUG in config.php to ignore this warning. Be warned that a standard PHP $error_type will still be shown.</p>";
       
  3252 		echo '<pre>';
       
  3253 		echo preg_replace('/^[^#].+$\n/m', '', enano_debug_print_backtrace(true));
       
  3254 		echo '</pre>';
       
  3255 		echo "<h1>Query list</h1>";
       
  3256 		global $db;
       
  3257 		echo "<pre>" . htmlspecialchars(print_r($db->query_backtrace, true)) . "</pre>";
       
  3258 		exit;
       
  3259 	}
       
  3260 	
       
  3261 	if ( strstr($errstr, "without first fetching all rows from a previous unbuffered query") )
       
  3262 	{
       
  3263 		$errstr .= "; define ENANO_DEBUG for a SQL query backtrace and help fixing this.";
       
  3264 	}
       
  3265 	
  3242 	if ( $do_gzip )
  3266 	if ( $do_gzip )
  3243 	{
  3267 	{
  3244 		$php_errors[] = array(
  3268 		$php_errors[] = array(
  3245 				'num' => $errno,
  3269 				'num' => $errno,
  3246 				'type' => $error_type,
  3270 				'type' => $error_type,