Skip to content

Commit

Permalink
merge r4426 from branch 2.0 to trunk
Browse files Browse the repository at this point in the history
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/trunk@4427 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Dec 4, 2009
1 parent 110ce79 commit 9c5cfbc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions include/ws_core.inc.php
Expand Up @@ -269,7 +269,7 @@ private static function _mergeAttributesAndContent(&$value)

private static function _removeNamedArray(&$value)
{
if ( strtolower( get_class($value) ) =='pwgnamedarray')
if ( strtolower( @get_class($value) ) =='pwgnamedarray')
{
$value = $value->_content;
return 1;
Expand All @@ -279,7 +279,7 @@ private static function _removeNamedArray(&$value)

private static function _removeNamedStruct(&$value)
{
if ( strtolower( get_class($value) ) =='pwgnamedstruct')
if ( strtolower( @get_class($value) ) =='pwgnamedstruct')
{
if ( isset($value->_content['']) )
{
Expand Down Expand Up @@ -524,7 +524,7 @@ function invoke($methodName, $params)
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']) )
{
Expand Down
2 changes: 1 addition & 1 deletion include/ws_protocols/json_encoder.php
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion include/ws_protocols/php_encoder.php
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions include/ws_protocols/rest_encoder.php
Expand Up @@ -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 = '<?xml version="1.0"?>
Expand Down Expand Up @@ -259,7 +259,7 @@ function encode($data, $xml_attributes=array() )
}
break;
case 'object':
switch ( strtolower(get_class($data)) )
switch ( strtolower(@get_class($data)) )
{
case 'pwgnamedarray':
$this->encode_array($data->_content, $data->_itemName, $data->_xmlAttributes);
Expand All @@ -273,7 +273,7 @@ function encode($data, $xml_attributes=array() )
}
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 );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion include/ws_protocols/xmlrpc_encoder.php
Expand Up @@ -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();
Expand Down

0 comments on commit 9c5cfbc

Please sign in to comment.