Fatal Error in MediaItemHandler with strict error reporting
-----------------------------------------------------------
Key: SHINDIG-1405
URL: https://issues.apache.org/jira/browse/SHINDIG-1405
Project: Shindig
Issue Type: Bug
Components: PHP
Reporter: Bastian Hofmann
In PHP you should only pass variables by reference. If you turn error reporting
to strict this even causes a fatal error:
--- - 2010-07-29 15:22:40.000000000 +0200
+++ php/src/social/service/MediaItemHandler.php 2010-07-29 12:11:11.000000000
+0200
@@ -126,7 +126,8 @@
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,9 @@
} 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;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.