Permalink
Browse files

Merge pull request #1 from nburka/trunk

Respect the error_reporting ini setting so that the full details of the ...
  • Loading branch information...
CloCkWeRX committed Jan 29, 2013
2 parents 0bc7a10 + dc5de47 commit 4be2d64154f4a235dbe3af78eddf037ed0a274c0
Showing with 11 additions and 3 deletions.
  1. +6 −2 XML/RPC2/Backend/Php/Server.php
  2. +5 −1 XML/RPC2/Backend/Xmlrpcext/Server.php
@@ -136,8 +136,12 @@ public function getResponse()
} catch (XML_RPC2_FaultException $e) {
return (XML_RPC2_Backend_Php_Response::encodeFault($e->getFaultCode(), $e->getMessage(), $this->encoding));
} catch (Exception $e) {
- return (XML_RPC2_Backend_Php_Response::encodeFault(1, 'Unhandled ' . get_class($e) . ' exception:' . $e->getMessage() . $e->getTraceAsString(), $this->encoding));
- }
+ if (ini_get('display_errors') == 1) {
+ return (XML_RPC2_Backend_Php_Response::encodeFault(1, 'Unhandled ' . get_class($e) . ' exception:' . $e->getMessage() . $e->getTraceAsString(), $this->encoding));
+ } else {
+ return XML_RPC2_Backend_Php_Response::encodeFault(1, 'Unhandled PHP Exception', $this->encoding);
+ }
+ }
}
}
@@ -166,7 +166,11 @@ public function getResponse()
} catch (XML_RPC2_FaultException $e) {
return (XML_RPC2_Backend_Php_Response::encodeFault($e->getFaultCode(), $e->getMessage()));
} catch (Exception $e) {
- return (XML_RPC2_Backend_Php_Response::encodeFault(1, 'Unhandled ' . get_class($e) . ' exception:' . $e->getMessage()));
+ if (ini_get('display_errors') == 1) {
+ return (XML_RPC2_Backend_Php_Response::encodeFault(1, 'Unhandled ' . get_class($e) . ' exception:' . $e->getMessage()));
+ } else {
+ return XML_RPC2_Backend_Php_Response::encodeFault(1, 'Unhandled PHP Exception');
+ }
}
}
// }}}

0 comments on commit 4be2d64

Please sign in to comment.