]> git.mxchange.org Git - friendica.git/blobdiff - mod/filerm.php
the Quattro admin_user template was missing the users note for the admin
[friendica.git] / mod / filerm.php
index 66b684dc964b69cb5a140d8dc176e0172feb59a7..7dd7df2f5ad47fadf6d74702732b757866841903 100644 (file)
@@ -1,21 +1,30 @@
 <?php
 
-function filerm_content(&$a) {
+function filerm_content(App $a) {
 
-       if(! local_user()) {
+       if (! local_user()) {
                killme();
        }
 
-       $term = notags(trim($_GET['term']));
-       $item_id = (($a->argc > 1) ? notags(trim($a->argv[1])) : 0);
+       $term = unxmlify(trim($_GET['term']));
+       $cat = unxmlify(trim($_GET['cat']));
+
+       $category = (($cat) ? true : false);
+       if ($category) {
+               $term = $cat;
+       }
+
+       $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
 
        logger('filerm: tag ' . $term . ' item ' . $item_id);
 
-       if($item_id && strlen($term))
-               file_tag_unsave_file(local_user(),$item_id,$term);
+       if ($item_id && strlen($term)) {
+               file_tag_unsave_file(local_user(),$item_id,$term, $category);
+       }
+
+       if (x($_SESSION,'return_url')) {
+               goaway(App::get_baseurl() . '/' . $_SESSION['return_url']);
+       }
 
-       if(x($_SESSION,'return_url'))
-               goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
-       
        killme();
 }