PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Web Services » SOAP » Bug #9155

SOAP_Server::_errorHandler should query error_reporting()

Details

Submitted2006-10-24 21:34 UTC
Frompear at tmp dot dau-sicher dot de
Assignedyunosh
StatusClosed
PackageSOAP
PHP Version5.1.6
OSGentoo Linux
Roadmaps(Not assigned)

Comments

[2006-10-24 21:34 UTC] pear at tmp dot dau-sicher dot de

Description:
------------
The method Server::_errorHandler should query the error_reporting()-Function to recognize suppressed errors (see http://de3.php.net/manual/en/language.operators.errorcontrol.php, comment by "webmaster __AT__ digitalanime __DOT__ nl" on 19-May-2004 12:10).

In Server.php, replace
if (!$errno || $errno == E_NOTICE ||
(defined('E_STRICT') && $errno == constant('E_STRICT'))) {
return;
}

with

if (error_reporting() == 0 || !$errno || $errno == E_NOTICE ||
(defined('E_STRICT') && $errno == constant('E_STRICT'))) {
return;
}

Test script:
---------------
function someDispatchedSoapFunction() {
if ($fp = @fopen("nonExistingFile.txt")) {
// do something strange
}
return "foo";
}

Expected result:
----------------
Get String-Response "foo"

Actual result:
--------------
SOAP-Fault about missing file

[2006-10-25 19:40 UTC] pear at tmp dot dau-sicher dot de

To make this work as expected, the @-Operator has to be removed from SOAP_Server::callMethod body. I don't see why it should be useful to run call_user_func with an error supression operator?