Add Horde_Url::redirect().
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 30 Jul 2010 18:13:15 +0000 (12:13 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 30 Jul 2010 18:13:15 +0000 (12:13 -0600)
framework/Url/lib/Horde/Url.php
framework/Url/package.xml

index 84640fe..78cc1e8 100644 (file)
@@ -311,6 +311,15 @@ class Horde_Url
     }
 
     /**
+     * Sends a redirect request to the browser to the URL in this object.
+     */
+    public function redirect()
+    {
+        header('Location: ' . strval($this->setRaw(true)));
+        exit;
+    }
+
+    /**
      * URL-safe base64 encoding, with trimmed '='.
      *
      * @param string $string  String to encode.
index feeab51..be20f57 100644 (file)
@@ -29,7 +29,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <api>beta</api>
  </stability>
  <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Add Horde_Url::unique().
+ <notes>* Add Horde_Url::redirect().
+ * Add Horde_Url::unique().
  * Add support for callback function for toString conversion.
  * Add support for URL anchors.
  * Added Horde_Url::uriB64Encode() and Horde_Url::uriB64Decode().