Alpha
Share and Organize Code
login register
HotNewTop
F.A.Q.
1. To begin adding code first register.
2. Create your own tags for code that you add.
3. To see your own code click Me, to see all code click Everyone, or filter by people rob.
4. To follow a user, click on their username, rob and hit follow.
5. Add other code to your library by clicking the
button near the code titles (note that you can not edit these codes).
6. To create a copy of a code that you can edit use fork.
7. If you can't find your code, double check your filter settings as you can filter by Category, User and Tag simultaneously.
8. Add comments to a code by clicking on it's title or the comments link underneath it.

Undo potential damage caused by Magic Quotes (plain)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
if (get_magic_quotes_gpc() == 1) {
    // Magic quotes *should* be off, but just in case...
    $superglobals = array(&$_REQUEST, &$_GET, &$_POST, &$_COOKIE);
    foreach ($superglobals as &$superglobal) {
        $superglobal = removeMagicQuotes($superglobal);
    }
}

function removeMagicQuotes($data) {
    if (is_array($data) == false) {
        $data = stripslashes($data);
    } else foreach ($data as &$value) {
        $value = Helper::removeMagicQuotes($value);
    }
    return $data;
}
[+] (12) more...
comments (1) flag fork
A simple function that removes extra quoting from the $REQUEST, $ GET, $POST and $ COOKIE arrays if "magic_quotes" happens to be turned on. - rust 5 Years ago