diff options
author | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2011-02-05 09:19:03 +0100 |
---|---|---|
committer | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2011-02-05 09:19:03 +0100 |
commit | 0c83fb4d807d2cdf78acc4bd206bc7b278b01f53 (patch) | |
tree | 1d0641cc3ac5641c2ce289e9720ba212e56214fb /mod/lockview.php | |
parent | acd5f49d437e5d399dbf907031f2b50d9257e18e (diff) | |
parent | 8cced061bba8d5ef18e2fa5ead0edcdc90d06e73 (diff) | |
download | volse-hubzilla-0c83fb4d807d2cdf78acc4bd206bc7b278b01f53.tar.gz volse-hubzilla-0c83fb4d807d2cdf78acc4bd206bc7b278b01f53.tar.bz2 volse-hubzilla-0c83fb4d807d2cdf78acc4bd206bc7b278b01f53.zip |
Merge branch 'master' of git://github.com/friendika/friendika
Diffstat (limited to 'mod/lockview.php')
-rw-r--r-- | mod/lockview.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/mod/lockview.php b/mod/lockview.php index a886effeb..9e64e2608 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -2,12 +2,23 @@ function lockview_content(&$a) { - - $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0); + + $type = (($a->argc > 1) ? $a->argv[1] : 0); + if (is_numeric($type)) { + $item_id = intval($type); + $type='item'; + } else { + $item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0); + } + if(! $item_id) killme(); - $r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1", + if (!in_array($type, array('item','photo','event'))) + killme(); + + $r = q("SELECT * FROM `%s` WHERE `id` = %d LIMIT 1", + dbesc($type), intval($item_id) ); if(! count($r)) |