SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot Ace Nova's Avatar
    Join Date
    Aug 2000
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    No Ending Delimiter Error

    This Code from phpBB is giving me a No ending Delimeter Error.
    HELP!


    /**
    * Less agressive version of stripslashes. Only replaces \\ \' and \"
    * The PHP stripslashes() also removed single backslashes from the string.
    * Expects a string or array as an argument.
    * Returns the result.
    */
    function own_stripslashes($string)
    {
    $find = array(
    '/\\\\\'/', // \\\'
    '/\\\\/', // \\
    '/\\\'/', // \'
    '/\\\"/'); // \"
    $replace = array(
    '\'', // \
    '\\', // \
    '\'', // '
    '"'); // "
    return preg_replace($find, $replace, $string);
    }
    Last edited by Ace Nova; Jun 21, 2001 at 17:22.
    Ace Nova
    Football Man
    InternetSprite.Com - Coming Soon!

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    '/\\\'/', // '

    That's the problem line, as I see it. The double-backslash becomes a literal backslash and then the quote following it terminates the string.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


Bookmarks

Posting Permissions

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