Skip to content
Snippets Groups Projects
Commit 36c31b0e authored by Florian Pritz's avatar Florian Pritz
Browse files

fix warning when uploading file using webdav


When uploading a file using davfs php warned about a missing argument to
OC_FileProxy_Quota::preFile_put_contents(). Since we get a resource from
OC_Connector_Sabre_File->put(), we have to convert that before running
strlen because it expects a string.

Signed-off-by: default avatarFlorian Pritz <bluewind@xinu.at>
parent c7d4e723
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,9 @@ class OC_FileProxy_Quota extends OC_FileProxy{
}
public function preFile_put_contents($path,$data){
if (is_resource($data)) {
$data = stream_get_contents($data);
}
return (strlen($data)<$this->getFreeSpace() or $this->getFreeSpace()==0);
}
......
......@@ -454,7 +454,7 @@ class OC_Filesystem{
* @return mixed
*/
private static function basicOperation($operation,$path,$hooks=array(),$extraParam=null){
if(OC_FileProxy::runPreProxies($operation,$path) and self::canRead($path) and $storage=self::getStorage($path)){
if(OC_FileProxy::runPreProxies($operation,$path, $extraParam) and self::canRead($path) and $storage=self::getStorage($path)){
$interalPath=self::getInternalPath($path);
$run=true;
foreach($hooks as $hook){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment