Bug #15924 [Opn]: Warning: split() [function.split]: Invalid preceding regular expression

From: Date: Sun, 01 Mar 2009 22:38:54 +0000
Subject: Bug #15924 [Opn]: Warning: split() [function.split]: Invalid preceding regular expression
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-98@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=15924&edit=1 ID: 15924 Updated by: daniel.oconnor@gmail.com Reported By: shamantobi at gmail dot com Summary: Warning: split() [function.split]: Invalid preceding regular expression Status: Open Type: Bug Package: Structures_BibTex Operating System: Linux PHP Version: 5.2.5 -Assigned To: +Assigned To: hugoki Roadmap Versions: New Comment: <div id="changeset"> <span class="removed">-Assigned To:</span> <span class="added">+Assigned To: hugoki</span> </div> Previous Comments: ------------------------------------------------------------------------ [2009-02-20 21:11:48] lgalarra Description: ------------ Dear developers: My project (http://joomla-research.com) is using this library to parse sets of Bibtex entries, however a user reported a really strange bug in which the parse method could not retrieve the type of entry ('entryType' property in the result array). By debugging the code I found the following problem in line 423 : split() [function.split]: Invalid preceding regular expression in ... line 423 which produces variable $arr to be empty. I check PHP documentation for function split and found that this takes a pattern as first parameter which made me realize, regexp special characters should be escaped. The mentioned line says: $arr = split('{', $entry); I changed it to: $arr = split('\{', $entry); and the bug was gone. I have to add that my user is using PHP 5.2.6 (Why does it not appear in the list?) It is the first time something similar happen. Furthermore, this change did not affect other installations. Test script: --------------- Expected result: ---------------- Actual result: -------------- ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=15924&edit=1

« previous php.pear.bugs (#98) next »