diff options
Diffstat (limited to 'apps/files_sharing/ajax/publicpreview.php')
-rw-r--r-- | apps/files_sharing/ajax/publicpreview.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php index 7685cda9d71..bb8df82775d 100644 --- a/apps/files_sharing/ajax/publicpreview.php +++ b/apps/files_sharing/ajax/publicpreview.php @@ -36,20 +36,20 @@ $keepAspect = array_key_exists('a', $_GET) ? true : false; if($token === ''){ \OC_Response::setStatus(\OC_Response::STATUS_BAD_REQUEST); - \OC_Log::write('core-preview', 'No token parameter was passed', \OC_Log::DEBUG); + \OCP\Util::writeLog('core-preview', 'No token parameter was passed', \OCP\Util::DEBUG); exit; } $linkedItem = \OCP\Share::getShareByToken($token); if($linkedItem === false || ($linkedItem['item_type'] !== 'file' && $linkedItem['item_type'] !== 'folder')) { \OC_Response::setStatus(\OC_Response::STATUS_NOT_FOUND); - \OC_Log::write('core-preview', 'Passed token parameter is not valid', \OC_Log::DEBUG); + \OCP\Util::writeLog('core-preview', 'Passed token parameter is not valid', \OCP\Util::DEBUG); exit; } if(!isset($linkedItem['uid_owner']) || !isset($linkedItem['file_source'])) { \OC_Response::setStatus(\OC_Response::STATUS_INTERNAL_SERVER_ERROR); - \OC_Log::write('core-preview', 'Passed token seems to be valid, but it does not contain all necessary information . ("' . $token . '")', \OC_Log::WARN); + \OCP\Util::writeLog('core-preview', 'Passed token seems to be valid, but it does not contain all necessary information . ("' . $token . '")', \OCP\Util::WARN); exit; } @@ -70,7 +70,7 @@ if($linkedItem['item_type'] === 'folder') { $isValid = \OC\Files\Filesystem::isValidPath($file); if(!$isValid) { \OC_Response::setStatus(\OC_Response::STATUS_BAD_REQUEST); - \OC_Log::write('core-preview', 'Passed filename is not valid, might be malicious (file:"' . $file . '";ip:"' . \OC::$server->getRequest()->getRemoteAddress() . '")', \OC_Log::WARN); + \OCP\Util::writeLog('core-preview', 'Passed filename is not valid, might be malicious (file:"' . $file . '";ip:"' . \OC::$server->getRequest()->getRemoteAddress() . '")', \OCP\Util::WARN); exit; } $sharedFile = \OC\Files\Filesystem::normalizePath($file); @@ -89,7 +89,7 @@ if(substr($path, 0, 1) === '/') { if($maxX === 0 || $maxY === 0) { \OC_Response::setStatus(\OC_Response::STATUS_BAD_REQUEST); - \OC_Log::write('core-preview', 'x and/or y set to 0', \OC_Log::DEBUG); + \OCP\Util::writeLog('core-preview', 'x and/or y set to 0', \OCP\Util::DEBUG); exit; } @@ -106,5 +106,5 @@ try{ $preview->showPreview(); } catch (\Exception $e) { \OC_Response::setStatus(\OC_Response::STATUS_INTERNAL_SERVER_ERROR); - \OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG); + \OCP\Util::writeLog('core', $e->getmessage(), \OCP\Util::DEBUG); } |