diff options
author | Mario <mario@mariovavti.com> | 2024-03-06 16:08:53 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-03-06 16:08:53 +0000 |
commit | b5b8106e7a14d11579de6479187a4a920b3aaab9 (patch) | |
tree | 1871f0170b65dd3c71c6155079eab4e0e5c989d9 /Zotlabs/Module/Thing.php | |
parent | b77100ff6d853883e7f28f7d4f2c486857cd16d2 (diff) | |
download | volse-hubzilla-b5b8106e7a14d11579de6479187a4a920b3aaab9.tar.gz volse-hubzilla-b5b8106e7a14d11579de6479187a4a920b3aaab9.tar.bz2 volse-hubzilla-b5b8106e7a14d11579de6479187a4a920b3aaab9.zip |
minor refactor
Diffstat (limited to 'Zotlabs/Module/Thing.php')
-rw-r--r-- | Zotlabs/Module/Thing.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Zotlabs/Module/Thing.php b/Zotlabs/Module/Thing.php index 3bf902fb0..2038db8c0 100644 --- a/Zotlabs/Module/Thing.php +++ b/Zotlabs/Module/Thing.php @@ -21,10 +21,12 @@ class Thing extends \Zotlabs\Web\Controller { dbesc(argv(1)) ); - if($r) { - $sql_extra = permissions_sql($r[0]['obj_channel']); + if (!$r) { + http_status_exit(404, 'Not found'); } + $sql_extra = permissions_sql($r[0]['obj_channel']); + $r = q("select * from obj where obj_type = %d and obj_obj = '%s' $sql_extra limit 1", intval(TERM_OBJ_THING), dbesc(argv(1)) @@ -36,6 +38,7 @@ class Thing extends \Zotlabs\Web\Controller { } http_status_exit(404, 'Not found'); + } } @@ -269,8 +272,13 @@ class Thing extends \Zotlabs\Web\Controller { intval(TERM_OBJ_THING), dbesc(argv(1)) ); - if($r) - $sql_extra = permissions_sql($r[0]['obj_channel']); + + if (!$r) { + notice( t('item not found.') . EOL); + return; + } + + $sql_extra = permissions_sql($r[0]['obj_channel']); $r = q("select * from obj where obj_type = %d and obj_obj = '%s' $sql_extra limit 1", intval(TERM_OBJ_THING), |