Changeset 2502
- Timestamp:
- Sep 5, 2008, 3:24:01 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r2495 r2502 1833 1833 function create_table_add_character_set($query) 1834 1834 { 1835 defined('DB_CHARSET') or trigger_error('create_table_add_character_set DB_CHARSET undefined', E_USER_ERROR);1835 defined('DB_CHARSET') or fatal_error('create_table_add_character_set DB_CHARSET undefined'); 1836 1836 if ('DB_CHARSET'!='') 1837 1837 { -
trunk/include/common.inc.php
r2488 r2502 22 22 // +-----------------------------------------------------------------------+ 23 23 24 if (!defined('PHPWG_ROOT_PATH')) 25 { 26 die('Hacking attempt!'); 27 } 24 defined('PHPWG_ROOT_PATH') or trigger_error('Hacking attempt!', E_USER_ERROR); 25 28 26 // determine the initial instant to indicate the generation time of this page 29 27 $t1 = explode( ' ', microtime() ); … … 147 145 148 146 defined('PWG_CHARSET') and defined('DB_CHARSET') 149 or die('PWG_CHARSET and/or DB_CHARSET is not defined');147 or fatal_error('PWG_CHARSET and/or DB_CHARSET is not defined'); 150 148 if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) 151 149 { … … 159 157 if ( strtolower(PWG_CHARSET)!='iso-8859-1' ) 160 158 { 161 die('PWG supports only iso-8859-1 charset on MySql version '.mysql_get_server_info());159 fatal_error('PWG supports only iso-8859-1 charset on MySql version '.mysql_get_server_info()); 162 160 } 163 161 } -
trunk/include/functions.inc.php
r2497 r2502 233 233 if ($mkd==false) 234 234 { 235 !($flags&MKGETDIR_DIE_ON_ERROR) or trigger_error( "$dir ".l10n('no_write_access'), E_USER_ERROR);235 !($flags&MKGETDIR_DIE_ON_ERROR) or fatal_error( "$dir ".l10n('no_write_access')); 236 236 return false; 237 237 } … … 251 251 if ( !is_writable($dir) ) 252 252 { 253 !($flags&MKGETDIR_DIE_ON_ERROR) or trigger_error( "$dir ".l10n('no_write_access'), E_USER_ERROR);253 !($flags&MKGETDIR_DIE_ON_ERROR) or fatal_error( "$dir ".l10n('no_write_access')); 254 254 return false; 255 255 } … … 946 946 // my_error returns (or send to standard output) the message concerning the 947 947 // error occured for the last mysql query. 948 949 948 function my_error($header, $die) 950 949 { 951 $error = $header; 952 $error.= "\n[mysql error ".mysql_errno().'] '.mysql_error()."\n"; 953 954 if (function_exists('debug_backtrace')) 955 { 956 $bt = debug_backtrace(); 957 for ($i=0; $i<count($bt); $i++) 958 { 959 $error .= "#$i\t".@$bt[$i]['function']." ".@$bt[$i]['file']."(".@@$bt[$i]['line'].")\n"; 960 } 961 } 950 $error = "[mysql error ".mysql_errno().'] '.mysql_error()."\n"; 951 $error .= $header; 962 952 963 953 if ($die) 964 954 { 965 @set_status_header(500); 966 echo( str_repeat( ' ', 300)."\n"); //IE doesn't error output if below a size 955 fatal_error($error); 967 956 } 968 957 echo("<pre>"); 969 trigger_error($error, $die ? E_USER_ERROR : E_USER_WARNING); 970 !$die || die($error); // just in case the handler didnt die 958 trigger_error($error, E_USER_WARNING); 971 959 echo("</pre>"); 972 960 } … … 1138 1126 else 1139 1127 { 1140 die('l10n_args: Invalid arguments');1128 fatal_error('l10n_args: Invalid arguments'); 1141 1129 } 1142 1130 … … 1222 1210 if ((mysql_num_rows($result) == 0) and !empty($condition)) 1223 1211 { 1224 die('No configuration data');1212 fatal_error('No configuration data'); 1225 1213 } 1226 1214 … … 1372 1360 function get_pwg_charset() 1373 1361 { 1374 defined('PWG_CHARSET') or die('load_language PWG_CHARSET undefined');1362 defined('PWG_CHARSET') or fatal_error('load_language PWG_CHARSET undefined'); 1375 1363 return PWG_CHARSET; 1376 1364 } -
trunk/include/functions_calendar.inc.php
r2299 r2502 116 116 117 117 // Retrieve calendar field 118 if ( !isset( $fields[ $page['chronology_field'] ] ) ) 119 { 120 die('bad chronology field'); 121 } 118 isset( $fields[ $page['chronology_field'] ] ) or fatal_error('bad chronology field'); 122 119 123 120 // Retrieve style … … 199 196 $must_show_list = false; 200 197 } 201 198 202 199 $page['comment'] = ''; 203 200 $template->assign('FILE_CHRONOLOGY_VIEW', 'month_calendar.tpl'); -
trunk/include/functions_html.inc.php
r2488 r2502 651 651 } 652 652 653 /** 654 * exits the current script with 500 http code 655 * this method can be called at any time (does not use template/language/user etc...) 656 * @param string msg a message to display 657 */ 658 function fatal_error($msg) 659 { 660 $btrace_msg = ''; 661 if (function_exists('debug_backtrace')) 662 { 663 $bt = debug_backtrace(); 664 for ($i=1; $i<count($bt); $i++) 665 { 666 $class = isset($bt[$i]['class']) ? (@$bt[$i]['class'].'::') : ''; 667 $btrace_msg .= "#$i\t".$class.@$bt[$i]['function'].' '.@$bt[$i]['file']."(".@$bt[$i]['line'].")\n"; 668 } 669 $btrace_msg = trim($btrace_msg); 670 $msg .= "\n"; 671 } 672 673 $display = "<h1>Piwigo encountered a non recoverable error</h1> 674 <pre style='font-size:larger;background:white;color:red;padding:1em;margin:0;clear:both;display:block;width:auto;height:auto;overflow:auto'> 675 <b>$msg</b> 676 $btrace_msg 677 </pre>\n"; 678 679 @set_status_header(500); 680 echo $display.str_repeat( ' ', 300); //IE doesn't error output if below a size 681 682 if ( function_exists('ini_set') ) 683 {// if possible turn off error display (we display it) 684 ini_set('display_errors', false); 685 } 686 error_reporting( E_ALL ); 687 trigger_error( strip_tags($msg).$btrace_msg, E_USER_ERROR ); 688 die(0); // just in case 689 } 690 653 691 /* returns the title to be displayed above thumbnails on tag page 654 692 */ -
trunk/include/functions_url.inc.php
r2299 r2502 220 220 { 221 221 global $conf; 222 if (!isset($params['image_id'])) 223 { 224 die('make_picture_url: image_id is a required parameter'); 225 } 222 223 isset($params['image_id']) or fatal_error('make_picture_url: image_id is a required parameter'); 226 224 227 225 $url = get_root_url().'picture'; … … 376 374 if (!isset($params['tags']) or count($params['tags']) == 0) 377 375 { 378 die('make_section_in_url: require at least one tag');376 fatal_error('make_section_in_url: require at least one tag'); 379 377 } 380 378 … … 407 405 case 'search' : 408 406 { 409 if (!isset($params['search'])) 410 { 411 die('make_section_in_url: require a search identifier'); 412 } 413 407 isset($params['search']) or fatal_error('make_section_in_url: require a search identifier'); 414 408 $section_string.= '/search/'.$params['search']; 415 416 409 break; 417 410 } 418 411 case 'list' : 419 412 { 420 if (!isset($params['list'])) 421 { 422 die('make_section_in_url: require a list of items'); 423 } 424 413 isset($params['list']) or fatal_error('make_section_in_url: require a list of items'); 425 414 $section_string.= '/list/'.implode(',', $params['list']); 426 427 415 break; 428 416 } -
trunk/include/template.class.php
r2497 r2502 225 225 if ( !isset($this->files[$handle]) ) 226 226 { 227 trigger_error("Template->parse(): Couldn't load template file for handle $handle", E_USER_ERROR);227 fatal_error("Template->parse(): Couldn't load template file for handle $handle"); 228 228 } 229 229 -
trunk/plugins/SwiftThemeCreator/simul
-
Property
svn:ignore
set to
*
-
Property
svn:ignore
set to
Note: See TracChangeset
for help on using the changeset viewer.