<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=File_Gettext</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/6411" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/6411">
      <title>File_Gettext: Feature/Change Request 6411 [Open] Various fixes to regexes</title>
      <link>http://pear.php.net/bugs/6411</link>
      <content:encoded><![CDATA[<pre>File_Gettext Feature/Change Request
Reported by alan_k
2006-01-04T01:49:42+00:00
PHP: Irrelevant OS: all Package Version: 

Description:
------------
diff -pur File/Gettext/PO.php File.new/Gettext/PO.php
--- File/Gettext/PO.php	2005-12-30 16:36:45.000000000 +0800
+++ File.new/Gettext/PO.php	2005-12-30 16:35:35.000000000 +0800
@@ -64,8 +64,8 @@ class File_Gettext_PO extends File_Gette
         
         // match all msgid/msgstr entries
         $matched = preg_match_all(
-            '/(msgid\s+(&quot;([^&quot;]|\\\\&quot;)*?&quot;\s*)+)\s+' .
-            '(msgstr\s+(&quot;([^&quot;]|\\\\&quot;)*?&quot;\s*)+)/',
+            '/msgid\s+((?:&quot;.*(?&lt;!\\\\)&quot;\s*)+)\s+' .
+            'msgstr\s+((?:&quot;.*(?&lt;!\\\\)&quot;\s*)+)/',
             $contents, $matches
         );
         unset($contents);
@@ -76,10 +76,8 @@ class File_Gettext_PO extends File_Gette
         
         // get all msgids and msgtrs
         for ($i = 0; $i &lt; $matched; $i++) {
-            $msgid = preg_replace(
-                '/\s*msgid\s*&quot;(.*)&quot;\s*/s', '\\1', $matches[1][$i]);
-            $msgstr= preg_replace(
-                '/\s*msgstr\s*&quot;(.*)&quot;\s*/s', '\\1', $matches[4][$i]);
+            $msgid = substr(trim($matches[1][$i]), 1, -1);
+            $msgstr = substr(trim($matches[2][$i]), 1, -1);
             $this-&gt;strings[parent::prepare($msgid)] = parent::prepare($msgstr);
         }
         
diff -pur File/Gettext.php File.new/Gettext.php
--- File/Gettext.php	2005-12-30 16:36:45.000000000 +0800
+++ File.new/Gettext.php	2005-12-30 16:35:41.000000000 +0800
@@ -131,12 +131,12 @@ class File_Gettext
     function prepare($string, $reverse = false)
     {
         if ($reverse) {
-            $smap = array('&quot;', &quot;\n&quot;, &quot;\t&quot;, &quot;\r&quot;);
-            $rmap = array('\\&quot;', '\\n&quot;' . &quot;\n&quot; . '&quot;', '\\t', '\\r');
+            $smap = array('\\', '&quot;', &quot;\n&quot;, &quot;\t&quot;, &quot;\r&quot;);
+            $rmap = array('\\\\', '\\&quot;', '\\n&quot;' . &quot;\n&quot; . '&quot;', '\\t', '\\r');
             return (string) str_replace($smap, $rmap, $string);
         } else {
-            $smap = array('/&quot;\s+&quot;/', '/\\\\n/', '/\\\\r/', '/\\\\t/', '/\\\\&quot;/');
-            $rmap = array('', &quot;\n&quot;, &quot;\r&quot;, &quot;\t&quot;, '&quot;');
+            $smap = array('/&quot;\s+&quot;/', '/\\\\n/', '/\\\\r/', '/\\\\t/', '/\\\\&quot;/', '/\\\\\\\\/');
+            $rmap = array('', &quot;\n&quot;, &quot;\r&quot;, &quot;\t&quot;, '&quot;', '\\');
             return (string) preg_replace($smap, $rmap, $string);
         }
     }</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_Gettext Feature/Change Request
Reported by alan_k
2006-01-04T01:49:42+00:00
PHP: Irrelevant OS: all Package Version: 

Description:
------------
diff -pur File/Gettext/PO.php File.new/Gettext/PO.php
--- File/Gettext/PO.php	2005-12-30 16:36:45.000000000 +0800
+++ File.new/Gettext/PO.php	2005-12-30 16:35:35.000000000 +0800
@@ -64,8 +64,8 @@ class File_Gettext_PO extends File_Gette
         
         // match all msgid/msgstr entries
         $matched = preg_match_all(
-            '/(msgid\s+(&quot;([^&quot;]|\\\\&quot;)*?&quot;\s*)+)\s+' .
-            '(msgstr\s+(&quot;([^&quot;]|\\\\&quot;)*?&quot;\s*)+)/',
+            '/msgid\s+((?:&quot;.*(?&lt;!\\\\)&quot;\s*)+)\s+' .
+            'msgstr\s+((?:&quot;.*(?&lt;!\\\\)&quot;\s*)+)/',
             $contents, $matches
         );
         unset($contents);
@@ -76,10 +76,8 @@ class File_Gettext_PO extends File_Gette
         
         // get all msgids and msgtrs
         for ($i = 0; $i &lt; $matched; $i++) {
-            $msgid = preg_replace(
-                '/\s*msgid\s*&quot;(.*)&quot;\s*/s', '\\1', $matches[1][$i]);
-            $msgstr= preg_replace(
-                '/\s*msgstr\s*&quot;(.*)&quot;\s*/s', '\\1', $matches[4][$i]);
+            $msgid = substr(trim($matches[1][$i]), 1, -1);
+            $msgstr = substr(trim($matches[2][$i]), 1, -1);
             $this-&gt;strings[parent::prepare($msgid)] = parent::prepare($msgstr);
         }
         
diff -pur File/Gettext.php File.new/Gettext.php
--- File/Gettext.php	2005-12-30 16:36:45.000000000 +0800
+++ File.new/Gettext.php	2005-12-30 16:35:41.000000000 +0800
@@ -131,12 +131,12 @@ class File_Gettext
     function prepare($string, $reverse = false)
     {
         if ($reverse) {
-            $smap = array('&quot;', &quot;\n&quot;, &quot;\t&quot;, &quot;\r&quot;);
-            $rmap = array('\\&quot;', '\\n&quot;' . &quot;\n&quot; . '&quot;', '\\t', '\\r');
+            $smap = array('\\', '&quot;', &quot;\n&quot;, &quot;\t&quot;, &quot;\r&quot;);
+            $rmap = array('\\\\', '\\&quot;', '\\n&quot;' . &quot;\n&quot; . '&quot;', '\\t', '\\r');
             return (string) str_replace($smap, $rmap, $string);
         } else {
-            $smap = array('/&quot;\s+&quot;/', '/\\\\n/', '/\\\\r/', '/\\\\t/', '/\\\\&quot;/');
-            $rmap = array('', &quot;\n&quot;, &quot;\r&quot;, &quot;\t&quot;, '&quot;');
+            $smap = array('/&quot;\s+&quot;/', '/\\\\n/', '/\\\\r/', '/\\\\t/', '/\\\\&quot;/', '/\\\\\\\\/');
+            $rmap = array('', &quot;\n&quot;, &quot;\r&quot;, &quot;\t&quot;, '&quot;', '\\');
             return (string) preg_replace($smap, $rmap, $string);
         }
     }</pre>]]></description>
      <dc:date>2008-04-06T08:41:24+00:00</dc:date>
      <dc:creator>alan &amp;#x61;&amp;#116; akbkhome &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>File_Gettext Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
