[dokuwiki] Re: Proposal for handling magic_quotes_gpc

  • From: "Harry Fuecks" <hfuecks@xxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 4 Mar 2006 01:07:01 +0100

Looks OK. For comparison, here's how it's been done in WACT
(http://www.phpwact.org);

function UndoMagicSlashing(&$var) {
    if(is_array($var)) {
        while(list($key, $val) = each($var)) {
            UndoMagicSlashing($var[$key]);
        }
    } else {
        $var = stripslashes($var);
    }
}

if (get_magic_quotes_gpc()) {
    UndoMagicSlashing($_GET);
    UndoMagicSlashing($_POST);
    UndoMagicSlashing($_COOKIES);
    UndoMagicSlashing($_REQUEST);
}

One school of thought says it's best to die and force people to switch
it off (e.g. other code they may be using with dokuwiki)

May give it a go on Sitepoint though.

On 3/3/06, Andreas Gohr <andi@xxxxxxxxxxxxxx> wrote:
> Hi *!
>
> As promised I wrote some ideas for handling magic_quotes_gpc to avoid
> bugs like we've just had with the punbb backend.
>
> http://wiki.splitbrain.org/magic_quotes_stripped
>
> Feedback and improvement to the page would be very welcome. I'd like to
> contact a few other open source developers about this, hopefully making
> them add it to their apps.
>
> Harry what do you think? Is it worth a blog entry at sitepoint? ;-)
>
> Andi
> --
> DokuWiki mailing list - more info at
> http://wiki.splitbrain.org/wiki:mailinglist
>
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: