From 4d706af6f5ded41e7d8d1ef6981136da58b7f3ad Mon Sep 17 00:00:00 2001 From: plegall Date: Fri, 4 Dec 2009 23:18:46 +0000 Subject: bug 1211 fixed: with PHP 5.3, the get_class function requires the input parameter to be an object, or else throws a E_WARNING message. In webservices files, I have replaced all "get_class" calls by "@get_class". git-svn-id: http://piwigo.org/svn/branches/2.0@4426 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/ws_core.inc.php | 6 +++--- include/ws_protocols/json_encoder.php | 2 +- include/ws_protocols/php_encoder.php | 2 +- include/ws_protocols/rest_encoder.php | 6 +++--- include/ws_protocols/xmlrpc_encoder.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/ws_core.inc.php b/include/ws_core.inc.php index c9ee520f6..80cc0736b 100644 --- a/include/ws_core.inc.php +++ b/include/ws_core.inc.php @@ -269,7 +269,7 @@ class PwgResponseEncoder private static function _removeNamedArray(&$value) { - if ( strtolower( get_class($value) ) =='pwgnamedarray') + if ( strtolower( @get_class($value) ) =='pwgnamedarray') { $value = $value->_content; return 1; @@ -279,7 +279,7 @@ class PwgResponseEncoder private static function _removeNamedStruct(&$value) { - if ( strtolower( get_class($value) ) =='pwgnamedstruct') + if ( strtolower( @get_class($value) ) =='pwgnamedstruct') { if ( isset($value->_content['']) ) { @@ -524,7 +524,7 @@ Request format: ".@$this->_requestFormat." Response format: ".@$this->_responseF return new PwgError(WS_ERR_MISSING_PARAM, 'Missing parameters: '.implode(',',$missing_params)); } $result = trigger_event('ws_invoke_allowed', true, $methodName, $params); - if ( strtolower( get_class($result) )!='pwgerror') + if ( strtolower( @get_class($result) )!='pwgerror') { if ( !empty($method['include']) ) { diff --git a/include/ws_protocols/json_encoder.php b/include/ws_protocols/json_encoder.php index 5931b8595..7e56ded2a 100644 --- a/include/ws_protocols/json_encoder.php +++ b/include/ws_protocols/json_encoder.php @@ -58,7 +58,7 @@ class PwgJsonEncoder extends PwgResponseEncoder { function encodeResponse($response) { - $respClass = strtolower( get_class($response) ); + $respClass = strtolower( @get_class($response) ); if ($respClass=='pwgerror') { return json_encode( diff --git a/include/ws_protocols/php_encoder.php b/include/ws_protocols/php_encoder.php index 954553834..58ec28f02 100644 --- a/include/ws_protocols/php_encoder.php +++ b/include/ws_protocols/php_encoder.php @@ -25,7 +25,7 @@ class PwgSerialPhpEncoder extends PwgResponseEncoder { function encodeResponse($response) { - $respClass = strtolower( get_class($response) ); + $respClass = strtolower( @get_class($response) ); if ($respClass=='pwgerror') { return serialize( diff --git a/include/ws_protocols/rest_encoder.php b/include/ws_protocols/rest_encoder.php index eb71d60fc..d0797f05b 100644 --- a/include/ws_protocols/rest_encoder.php +++ b/include/ws_protocols/rest_encoder.php @@ -152,7 +152,7 @@ class PwgRestEncoder extends PwgResponseEncoder { function encodeResponse($response) { - $respClass = strtolower( get_class($response) ); + $respClass = strtolower( @get_class($response) ); if ($respClass=='pwgerror') { $ret = ' @@ -259,7 +259,7 @@ class PwgRestEncoder extends PwgResponseEncoder } break; case 'object': - switch ( strtolower(get_class($data)) ) + switch ( strtolower(@get_class($data)) ) { case 'pwgnamedarray': $this->encode_array($data->_content, $data->_itemName, $data->_xmlAttributes); @@ -273,7 +273,7 @@ class PwgRestEncoder extends PwgResponseEncoder } break; default: - trigger_error("Invalid type ". gettype($data)." ".get_class($data), E_USER_WARNING ); + trigger_error("Invalid type ". gettype($data)." ".@get_class($data), E_USER_WARNING ); } } } diff --git a/include/ws_protocols/xmlrpc_encoder.php b/include/ws_protocols/xmlrpc_encoder.php index 0262434fa..4e868c14e 100644 --- a/include/ws_protocols/xmlrpc_encoder.php +++ b/include/ws_protocols/xmlrpc_encoder.php @@ -64,7 +64,7 @@ class PwgXmlRpcEncoder extends PwgResponseEncoder { function encodeResponse($response) { - $respClass = strtolower( get_class($response) ); + $respClass = strtolower( @get_class($response) ); if ($respClass=='pwgerror') { $code = $response->code(); -- cgit v1.2.3