Camen Design Forum

(NNF) Sticky function missing $url variable

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;
}
%

Append

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

Only the original author or a moderator can append to this post.

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

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn