Skip to content

Commit

Permalink
Fix public sharing
Browse files Browse the repository at this point in the history
Public sharing was broken because the legacy router passes those values as `$_GET` which has to be accessed this way in this situation.

Furthermore this makes legacy links work again as they used  `t` instead of `token`

Needs a backport to stable8.

Fixes #162 and #160
  • Loading branch information
LukasReschke committed Feb 14, 2015
1 parent 55cec18 commit b153b5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion appinfo/routes.php
Expand Up @@ -21,5 +21,5 @@
$this->create('gallery_ajax_batch', 'ajax/thumbnail/batch')
->actionInclude('gallery/ajax/batch.php');

$this->create('gallery_public', '/public/{token}')
$this->create('gallery_public', '/public/{t}')
->actionInclude('gallery/public.php');
2 changes: 1 addition & 1 deletion public.php
Expand Up @@ -25,7 +25,7 @@
OCP\Util::addStyle('gallery', 'styles');
OCP\Util::addStyle('gallery', 'mobile');

$token = \OC::$server->getRequest()->getParam('token');
$token = isset($_GET['t']) ? (string)$_GET['t'] : '';

if ($token) {
$linkItem = \OCP\Share::getShareByToken($token, false);
Expand Down

0 comments on commit b153b5b

Please sign in to comment.