[Mantisconnect-cvs] SF.net SVN: mantisconnect: [134] mantisconnect/trunk/webservice/mc/mc_api. php
Brought to you by:
vboctor
From: <vb...@us...> - 2007-04-22 00:35:16
|
Revision: 134 http://svn.sourceforge.net/mantisconnect/?rev=134&view=rev Author: vboctor Date: 2007-04-21 17:35:14 -0700 (Sat, 21 Apr 2007) Log Message: ----------- Fixed #324: Notice in Line 225 in File mc_api.php: $t_user_id is not defined. Modified Paths: -------------- mantisconnect/trunk/webservice/mc/mc_api.php Modified: mantisconnect/trunk/webservice/mc/mc_api.php =================================================================== --- mantisconnect/trunk/webservice/mc/mc_api.php 2007-03-27 20:27:37 UTC (rev 133) +++ mantisconnect/trunk/webservice/mc/mc_api.php 2007-04-22 00:35:14 UTC (rev 134) @@ -222,7 +222,7 @@ function mci_user_get_accessible_subprojects( $p_user_id, $p_parent_project_id ) { $t_result = array(); - foreach( user_get_accessible_subprojects( $t_user_id, $p_parent_project_id ) as $t_subproject_id ) { + foreach( user_get_accessible_subprojects( $p_user_id, $p_parent_project_id ) as $t_subproject_id ) { $t_subproject_row = project_cache_row( $t_subproject_id ); $t_subproject = array(); $t_subproject['id'] = $t_subproject_id; @@ -272,4 +272,86 @@ return $rows; } -?> \ No newline at end of file + # set up error_handler() as the new default error handling function + set_error_handler( 'mc_error_handler' ); + + ######################################### + # SECURITY NOTE: these globals are initialized here to prevent them + # being spoofed if register_globals is turned on + # + $g_error_parameters = array(); + $g_error_handled = false; + $g_error_proceed_url = null; + + # --------------- + # Default error handler + # + # This handler will not receive E_ERROR, E_PARSE, E_CORE_*, or E_COMPILE_* + # errors. + # + # E_USER_* are triggered by us and will contain an error constant in $p_error + # The others, being system errors, will come with a string in $p_error + # + function mc_error_handler( $p_type, $p_error, $p_file, $p_line, $p_context ) { + global $g_error_parameters, $g_error_handled, $g_error_proceed_url; + global $g_lang_overrides; + global $g_error_send_page_header; + + # check if errors were disabled with @ somewhere in this call chain + # also suppress php 5 strict warnings + if ( 0 == error_reporting() || 2048 == $p_type ) { + return; + } + + $t_lang_pushed = false; + + # flush any language overrides to return to user's natural default + if ( function_exists( 'db_is_connected' ) ) { + if ( db_is_connected() ) { + lang_push( lang_get_default() ); + $t_lang_pushed = true; + } + } + + $t_short_file = basename( $p_file ); + $t_method_array = config_get( 'display_errors' ); + if ( isset( $t_method_array[$p_type] ) ) { + $t_method = $t_method_array[$p_type]; + } else { + $t_method = 'none'; + } + + # build an appropriate error string + switch ( $p_type ) { + case E_WARNING: + $t_error_type = 'SYSTEM WARNING'; + $t_error_description = $p_error; + break; + case E_NOTICE: + $t_error_type = 'SYSTEM NOTICE'; + $t_error_description = $p_error; + break; + case E_USER_ERROR: + $t_error_type = "APPLICATION ERROR #$p_error"; + $t_error_description = error_string( $p_error ); + break; + case E_USER_WARNING: + $t_error_type = "APPLICATION WARNING #$p_error"; + $t_error_description = error_string( $p_error ); + break; + case E_USER_NOTICE: + # used for debugging + $t_error_type = 'DEBUG'; + $t_error_description = $p_error; + break; + default: + #shouldn't happen, just display the error just in case + $t_error_type = ''; + $t_error_description = $p_error; + } + + $t_error_description = nl2br( $t_error_description ); + + return new soap_fault( 'Server', '', $t_error_type . ': ' . $t_error_description ); + } +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |