<?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=Net_URL_Mapper</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/16675" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16050" />

     </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/16675">
      <title>Net_URL_Mapper: Feature/Change Request 16675 [Open] Net_URL &gt; Net_URL2</title>
      <link>http://pear.php.net/bugs/16675</link>
      <content:encoded><![CDATA[<pre>Net_URL_Mapper Feature/Change Request
Reported by till
2009-10-03T18:25:31+00:00
PHP: Irrelevant OS: n/a Package Version: CVS

Description:
------------
Not sure why Net_URL_Mapper depends on it, but here's an update to Net_URL2.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Net_URL_Mapper Feature/Change Request
Reported by till
2009-10-03T18:25:31+00:00
PHP: Irrelevant OS: n/a Package Version: CVS

Description:
------------
Not sure why Net_URL_Mapper depends on it, but here's an update to Net_URL2.</pre>]]></description>
      <dc:date>2009-10-19T08:41:10+00:00</dc:date>
      <dc:creator>till &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>Net_URL_Mapper Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16050">
      <title>Net_URL_Mapper: Bug 16050 [Open] URL generation problem with query parameters</title>
      <link>http://pear.php.net/bugs/16050</link>
      <content:encoded><![CDATA[<pre>Net_URL_Mapper Bug
Reported by ciarang
2009-03-20T20:36:40+00:00
PHP: Irrelevant OS: Etch Package Version: 0.9.0

Description:
------------
If you match a URL that contains a query string, then supply additional parameters when attempting to generate a new URL, the generator doesn't take into account the existing parameters and so incorrectly adds a '?' where an '&amp;' is required. For example, match:

  connect('search/notice?q=:q', array('action' =&gt; 'noticesearch'),array('q' =&gt; '.+'));

Then pass the following into generate():

$args - ( [action] =&gt; noticesearch, [q] =&gt; x)
$params - ([p] =&gt; 1 )

Instead of getting back &quot;/search/notice?q=x&amp;p=1&quot; you get the invalid &quot;/search/notice?q=x?p=1&quot;.


Test script:
---------------
This fixes it...

--- a/extlib/Net/URL/Mapper/Path.php
+++ b/extlib/Net/URL/Mapper/Path.php
@@ -241,7 +241,12 @@ class Net_URL_Mapper_Path
         }
         $path = '/'.trim(Net_URL::resolvePath($path), '/');
         if (!empty($qstring)) {
-            $path .= '?'.http_build_query($qstring);
+            if (!strpos($path, '?')) {
+                $path .= '?';
+            } else {
+                $path .= '&amp;';
+            }
+           $path .= http_build_query($qstring);
         }
         if (!empty($anchor)) {
             $path .= '#'.ltrim($anchor, '#');</pre>]]></content:encoded>
      <description><![CDATA[<pre>Net_URL_Mapper Bug
Reported by ciarang
2009-03-20T20:36:40+00:00
PHP: Irrelevant OS: Etch Package Version: 0.9.0

Description:
------------
If you match a URL that contains a query string, then supply additional parameters when attempting to generate a new URL, the generator doesn't take into account the existing parameters and so incorrectly adds a '?' where an '&amp;' is required. For example, match:

  connect('search/notice?q=:q', array('action' =&gt; 'noticesearch'),array('q' =&gt; '.+'));

Then pass the following into generate():

$args - ( [action] =&gt; noticesearch, [q] =&gt; x)
$params - ([p] =&gt; 1 )

Instead of getting back &quot;/search/notice?q=x&amp;p=1&quot; you get the invalid &quot;/search/notice?q=x?p=1&quot;.


Test script:
---------------
This fixes it...

--- a/extlib/Net/URL/Mapper/Path.php
+++ b/extlib/Net/URL/Mapper/Path.php
@@ -241,7 +241,12 @@ class Net_URL_Mapper_Path
         }
         $path = '/'.trim(Net_URL::resolvePath($path), '/');
         if (!empty($qstring)) {
-            $path .= '?'.http_build_query($qstring);
+            if (!strpos($path, '?')) {
+                $path .= '?';
+            } else {
+                $path .= '&amp;';
+            }
+           $path .= http_build_query($qstring);
         }
         if (!empty($anchor)) {
             $path .= '#'.ltrim($anchor, '#');</pre>]]></description>
      <dc:date>2009-03-20T20:36:40+00:00</dc:date>
      <dc:creator>ciaran &amp;#x61;&amp;#116; ciarang &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Net_URL_Mapper Bug</dc:subject>
    </item>
</rdf:RDF>
