You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

s.php 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. try {
  3. require_once 'lib/base.php';
  4. OC::checkMaintenanceMode();
  5. OC::checkSingleUserMode();
  6. $file = OCP\CONFIG::getAppValue('core', 'public_files');
  7. if(is_null($file)) {
  8. header('HTTP/1.0 404 Not Found');
  9. exit;
  10. }
  11. // convert the token to hex, if it's base36
  12. if (strlen((string)$_GET['t']) != 16 && strlen((string)$_GET['t']) != 32) {
  13. $_GET['t'] = base_convert($_GET['t'], 36, 16);
  14. // the token should have leading zeroes and needs to be padded
  15. if (strlen((string)$_GET['t']) != 16) {
  16. $padding = '';
  17. for ($i = 0; $i < (16 - strlen((string)$_GET['t'])); $i++) {
  18. $padding .= '0';
  19. }
  20. $_GET['t'] = $padding . $_GET['t'];
  21. }
  22. }
  23. print($_GET['t']);
  24. OC_Util::checkAppEnabled('files_sharing');
  25. OC_App::loadApp('files_sharing');
  26. OC_User::setIncognitoMode(true);
  27. require_once OC_App::getAppPath('files_sharing') .'/public.php';
  28. } catch (Exception $ex) {
  29. //show the user a detailed error page
  30. OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
  31. \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL);
  32. OC_Template::printExceptionErrorPage($ex);
  33. }