diff options
author | friendica <info@friendica.com> | 2012-10-23 17:14:50 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-10-23 17:14:50 -0700 |
commit | 8e8482355baa55a5c9e3cb3553eecf5a733e2897 (patch) | |
tree | 69aebb07dd105280cb40997f172b90e58c555510 /mod/attach.php | |
parent | 756dcd115e5785dc009bce1e75ebb54c8009dfa7 (diff) | |
download | volse-hubzilla-8e8482355baa55a5c9e3cb3553eecf5a733e2897.tar.gz volse-hubzilla-8e8482355baa55a5c9e3cb3553eecf5a733e2897.tar.bz2 volse-hubzilla-8e8482355baa55a5c9e3cb3553eecf5a733e2897.zip |
more heavy lifting
Diffstat (limited to 'mod/attach.php')
-rw-r--r-- | mod/attach.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mod/attach.php b/mod/attach.php index ae6540201..f300ec6fb 100644 --- a/mod/attach.php +++ b/mod/attach.php @@ -4,17 +4,17 @@ require_once('include/security.php'); function attach_init(&$a) { - if($a->argc != 2) { + if(argc() != 2) { notice( t('Item not available.') . EOL); return; } - $item_id = intval($a->argv[1]); + $hash = argv(1); // Check for existence, which will also provide us the owner uid - $r = q("SELECT * FROM `attach` WHERE `id` = %d LIMIT 1", - intval($item_id) + $r = q("SELECT * FROM `attach` WHERE `hash` = '%s' LIMIT 1", + dbesc($hash) ); if(! count($r)) { notice( t('Item was not found.'). EOL); @@ -25,8 +25,8 @@ function attach_init(&$a) { // Now we'll see if we can access the attachment - $r = q("SELECT * FROM `attach` WHERE `id` = '%d' $sql_extra LIMIT 1", - dbesc($item_id) + $r = q("SELECT * FROM `attach` WHERE hash = '%s' $sql_extra LIMIT 1", + dbesc($hash) ); if(! count($r)) { |