Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    bump for above post.
    Also, in what way can I make the code more efficient?
    Vouches
    [x][x]

  2. #12
    Join Date
    Jun 2008
    Location
    Manchester
    Posts
    766
    Tokens
    0

    Default

    function clean($str) {
    $str = trim($str);
    if(!mysql_real_escape_string()) {
    $str = addslashes($str);
    }

    $str = strip_tags(htmlspecialchars($str));
    return $str;
    }

    Security risk.

    function clean($str) {
    $str = trim($str);
    if(!get_magic_quotes_gpc()) {
    $str = addslashes($str);
    }
    $str = strip_tags(htmlspecialchars($str));
    return $str;
    }
    Last edited by Jxhn; 21-04-2009 at 06:19 PM.

  3. #13
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    That's what I originally had but Iszak told me it was pointless.
    Vouches
    [x][x]

  4. #14

    Default

    Erm? I don't remember telling you anything about that, I never use "!mysql_real_escape_string" I either use "function_exists" or "get_magic_quotes_gpc". Anyway most of my code uses strict checking too so I doubt it's me who said it.

  5. #15
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    You told me not to use magic_quotes_gpc or something.
    Vouches
    [x][x]

  6. #16

    Default

    I probably didn't tell you not to use it, but not to rely on it.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •