Author: lindner
Date: Tue Aug 10 08:56:40 2010
New Revision: 983893
URL: http://svn.apache.org/viewvc?rev=983893&view=rev
Log:
SHINDIG-1405 | Patch from Bastian Hofmann | Fatal Error in MediaItemHandler
with strict error reporting
Modified:
shindig/trunk/php/src/social/service/MediaItemHandler.php
Modified: shindig/trunk/php/src/social/service/MediaItemHandler.php
URL:
http://svn.apache.org/viewvc/shindig/trunk/php/src/social/service/MediaItemHandler.php?rev=983893&r1=983892&r2=983893&view=diff
==============================================================================
--- shindig/trunk/php/src/social/service/MediaItemHandler.php (original)
+++ shindig/trunk/php/src/social/service/MediaItemHandler.php Tue Aug 10
08:56:40 2010
@@ -126,7 +126,8 @@ class MediaItemHandler extends DataReque
throw new SocialSpiException("The content type " .
$response->getContentType() .
" fetched from $uri is not valid.", ResponseError::$BAD_REQUEST);
}
- return $this->writeBinaryContent($response->getResponseContent(),
$response->getContentType());
+ $content = $response->getResponseContent();
+ return $this->writeBinaryContent($content, $response->getContentType());
}
/**
@@ -159,7 +160,8 @@ class MediaItemHandler extends DataReque
} else if (isset($GLOBALS['HTTP_RAW_POST_DATA'])) {
// The REST api supports to post the file using the content type
'image/*', 'video/*' or 'audio/*'.
if ($this->isValidContentType($_SERVER['CONTENT_TYPE'])) {
- $file = $this->writeBinaryContent($GLOBALS['HTTP_RAW_POST_DATA'],
$_SERVER['CONTENT_TYPE']);
+ $postData = $GLOBALS['HTTP_RAW_POST_DATA'];
+ $file = $this->writeBinaryContent($postData, $_SERVER['CONTENT_TYPE']);
}
}
return $file;