Permalink
Browse files

Services_Pingback::send() must be save the current error handling

 first, then restore it when done. Don't interupting user setting.


git-svn-id: http://svn.php.net/repository/pear/packages/Services_Pingback/trunk@240669 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 7a73a0a commit 66d8023ceb31236407715c87398bbaf585c46068 Firman Wandayandi committed Aug 3, 2007
Showing with 8 additions and 0 deletions.
  1. +8 −0 Services/Pingback.php
View
@@ -583,6 +583,10 @@ function send($data = null)
$cli = new XML_RPC_Client($path, $url->protocol . '://' . $url->host, $url->port);
$cli->setDebug((int) $this->_options['debug']);
+ // save the current error handling in buffer for restore.
+ $default_error_mode = $GLOBALS['_PEAR_default_error_mode'];
+ $default_error_options = $GLOBALS['_PEAR_default_error_options'];
+
// Set error mode to callback, since XML_RPC doesn't return error object on failure.
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'XML_RPC_ErrorCallback'));
@@ -598,6 +602,9 @@ function send($data = null)
return PEAR::raiseError('Response Error: ' . $res->faultString());
}
+ // restore the current error handling.
+ PEAR::setErrorHandling($default_error_mode, $default_error_options);
+
return XML_RPC_decode($val);
}
@@ -1038,6 +1045,7 @@ function XML_RPC_ErrorCallback($error)
* Find the whether if XML_RPC have an error or not.
*
* @return bool
+ * @access private
*/
function _isXML_RPC_Error()
{

0 comments on commit 66d8023

Please sign in to comment.