• About Us
  • Blog
  • Basket
  • Account
  • Sign In
  •  

Forums

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 28 Jan 2014 09:29 AM by  Tom Holmes
(SOLVED)Bug(PHP/Lite data)preg_match_all Compilation failed lookbehind assertion is not fixed length
 5 Replies
Sort:
Topic is locked
Author Messages

Tyler Collier



New Member


Posts:
New Member


--
23 Jan 2014 03:58 AM
    I think I've discovered a bug. When I visit one of my sites that uses the 2013-10-19 version of the lite data, PHP code, I get this message:Warning: preg_match_all() [function.preg-match-all]: Compilation failed: lookbehind assertion is not fixed length at offset 21 in 51Degrees/Handlers/Calculations/RegexSegment.php on line 17My user agent isMozilla/5.0 (Linux; Android 4.3; en-us; SAMSUNG SM-N900V Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36This has been happening with recent versions of Samsung phones.Can you confirm if this is a bug? If not, what can I do to prevent this, aside from turning off error reporting in PHP?
    0

    Tom Holmes



    New Member


    Posts:
    New Member


    --
    23 Jan 2014 09:48 AM

    Hi,

    Thanks for contacting us. I have been unable to recreate the problem using that version of the data with the useragent provided. Have you ever used a different version of the data? Are you also able to redownload the detector from Sourceforge and try it again?

    Thanks,

    Tom

    0

    Tyler Collier



    New Member


    Posts:
    New Member


    --
    23 Jan 2014 06:14 PM

    On that line of code (RegexSegment.php line 17), here's the regular expression it's using:

    #(?i)(?<=SAMSUNG)-?[^/]+# Mozilla/5.0 (Linux; Android 4.3; en-us; SAMSUNG SM-N900V Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36 #(?i)(?<=SEC|SCH)-?[^/]+# Mozilla/5.0 (Linux; Android 4.3; en-us; SAMSUNG SM-N900V Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36 #(?<=Bada/)\d+\.\d+# Mozilla/5.0 (Linux; Android 4.3; en-us; SAMSUNG SM-N900V Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36 #(?<=Dolfin/)\d+\.\d+# Mozilla/5.0 (Linux; Android 4.3; en-us; SAMSUNG SM-N900V Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36 #(?<=Jasmine/)\d+\.\d+# Mozilla/5.0 (Linux; Android 4.3; en-us; SAMSUNG SM-N900V Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36 #(?<=NetFront/)[\d\.]+# Mozilla/5.0 (Linux; Android 4.3; en-us; SAMSUNG SM-N900V Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36 #(?<=UC(\.| |)Browser/)\d+\.\d+# Mozilla/5.0 (Linux; Android 4.3; en-us; SAMSUNG SM-N900V Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36 

    Towards the end is #(?<=UC(\.| |)Browser/)\d+\.\d+#, which is not fixed lengh. Am I correct in that? Where is that regex coming from?

    0

    Tom Holmes



    New Member


    Posts:
    New Member


    --
    24 Jan 2014 11:40 AM

    Hi,

    The regular expression you posted would create a problem in PHP, however, the lite data from October does not feature this expression. Can you please retry downloading the api from Sourceforge, replace your current installation and see if the problem persists?

    Thanks,

    Tom

    0

    Tyler Collier



    New Member


    Posts:
    New Member


    --
    27 Jan 2014 06:23 PM

    Hi Tom,

    You're right. I did in fact not have the version I said I did. I was confused based on my git branches. I updated the code to the 2013-10-19 branch and it the problem does not occur.

    I apologize about taking your time due to my mixup, but appreciate the help.

    Ty

    0

    Tom Holmes



    New Member


    Posts:
    New Member


    --
    28 Jan 2014 09:29 AM

    No problem at all, I'm glad we could help.

    Tom

    0
    Topic is locked