Camen Design Forum

(NNF) Sticky function missing $url variable

append delete justesting

Sticky function missing $url variable, php gives error:

Notice: Undefined variable: url in thread.php on line 61

% PHP
if (    (isset ($_POST['stick']) || isset ($_POST['unstick'])) &&
        //the site admin, or the first mod of the sub-forum have stick / unstick rights
        (IS_ADMIN || strtolower (NAME) === strtolower ((string) @$MODS['LOCAL'][0]))
) {
        //add or remove the filename from "sticky.txt"
        if (in_array ("$FILE.rss", $stickies = getStickies ())) {
                $stickies = array_diff ($stickies, array ("$FILE.rss"));
        } else {
                $stickies[] = "$FILE.rss";
        };
        
        file_put_contents ('sticky.txt', implode ("\r\n", $stickies), LOCK_EX);
        
        //regenerate the folder's RSS file
        indexRSS ();
        
        //redirect to eat the form submission
        header ("Location: $url", true, 303);
        exit;
}
%

Reply RSS

Replies

#1. Arabic

This post was deleted by its owner

#2. Arabic

This post was deleted by its owner

append delete #3. Arabic

//redirect to eat the form submission
header ("Location: index.php", true, 303);
exit;

append delete #4. Martijn

This looks like a definitive bug, you could file an issue with the official bug tracker at https://github.com/Kroc/NoNonsenseForum/issues

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn