X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Ftagrm.php;h=d6e57d36a93fe3e3664799b8158580e07bc49761;hb=f3529e7dbcad8af388764938230b1e864359fa83;hp=5041145cc323e2a99268b706b4c0c71e2049b832;hpb=8aa25523721303b6883e1a793f20997f8a33ec0a;p=friendica.git diff --git a/mod/tagrm.php b/mod/tagrm.php old mode 100755 new mode 100644 index 5041145cc3..d6e57d36a9 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -1,15 +1,15 @@ get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); if((x($_POST,'submit')) && ($_POST['submit'] === t('Cancel'))) - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); $tag = ((x($_POST,'tag')) ? hex2bin(notags(trim($_POST['tag']))) : ''); $item = ((x($_POST,'item')) ? intval($_POST['item']) : 0 ); @@ -19,8 +19,9 @@ function tagrm_post(&$a) { intval(local_user()) ); - if(! count($r)) - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + if (! dbm::is_result($r)) { + goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); + } $arr = explode(',', $r[0]['tag']); for($x = 0; $x < count($arr); $x ++) { @@ -32,14 +33,14 @@ function tagrm_post(&$a) { $tag_str = implode(',',$arr); - q("UPDATE `item` SET `tag` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1", + q("UPDATE `item` SET `tag` = '%s' WHERE `id` = %d AND `uid` = %d", dbesc($tag_str), intval($item), intval(local_user()) ); info( t('Tag removed') . EOL ); - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); // NOTREACHED @@ -52,13 +53,13 @@ function tagrm_content(&$a) { $o = ''; if(! local_user()) { - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); // NOTREACHED } $item = (($a->argc > 1) ? intval($a->argv[1]) : 0); if(! $item) { - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); // NOTREACHED } @@ -68,13 +69,14 @@ function tagrm_content(&$a) { intval(local_user()) ); - if(! count($r)) - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + if (! dbm::is_result($r)) { + goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); + } $arr = explode(',', $r[0]['tag']); if(! count($arr)) - goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); $o .= '

' . t('Remove Item Tag') . '

';