Results 1 to 7 of 7
  1. #1
    Join Date
    May 2009
    Posts
    4
    Plugin Contributions
    0

    Default what does this regexp means?

    located in "./admin/includes/application_top.php"
    line 121:
    $loaderPrefix = preg_replace('/[a-z_]^/', '', $loaderPrefix);

    what does this pattern "/[a-z_]^/" means?

    spell mistake?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,445
    Plugin Contributions
    81

    Default Re: what does this regexp means?

    No, that's not an error. It's very specific.
    It's stripping invalid characters from the passed parameter.
    More information on regex: http://www.regular-expressions.info/reference.html
    and the PHP preg_replace() function: http://www.php.net/manual/en/function.preg-replace.php
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    May 2009
    Posts
    4
    Plugin Contributions
    0

    Default Re: what does this regexp means?

    /[a-z_]^/ this caret means what? thanks

  4. #4
    Join Date
    Jan 2004
    Posts
    66,445
    Plugin Contributions
    81

    Default Re: what does this regexp means?

    In that case, the caret is a negation operator. So, that preg_replace statement replaces any characters not matching a-z or underscore with blanks, effectively removing bad characters.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    May 2009
    Posts
    4
    Plugin Contributions
    0

    Default Re: what does this regexp means?

    Quote Originally Posted by DrByte View Post
    In that case, the caret is a negation operator. So, that preg_replace statement replaces any characters not matching a-z or underscore with blanks, effectively removing bad characters.
    you means [^a-z_] ?

  6. #6
    Join Date
    May 2009
    Posts
    4
    Plugin Contributions
    0

    Default Re: what does this regexp means?

    var_dump(preg_match('/[a-z_]^/',"A"))

    result is false

  7. #7
    Join Date
    Jan 2004
    Posts
    66,445
    Plugin Contributions
    81

    Default Re: what does this regexp means?

    Are you running into a particular problem with your store?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. does anyone know what this means?
    By lizmarin in forum General Questions
    Replies: 1
    Last Post: 16 Feb 2010, 08:02 PM
  2. anyone know what this means?
    By nicholle in forum General Questions
    Replies: 3
    Last Post: 22 Sep 2007, 10:31 PM
  3. Can anyone tell me what this means?
    By buyashed in forum General Questions
    Replies: 1
    Last Post: 9 Jun 2007, 08:50 PM
  4. Does anyone know what this PHP error means?
    By bradlawson in forum General Questions
    Replies: 0
    Last Post: 4 May 2007, 09:12 AM
  5. Any Ideas on what this error means?
    By NickC in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 5 Jan 2007, 03:25 PM

Posting Permissions

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