$url = self::url($url, $full, 0, $force_ssl);
return $nocache
- ? Horde_Util::nocacheUrl($url, !$full)
+ ? self::nocacheUrl($url)
: $url;
}
/**
+ * Returns a url with the 'nocache' parameter added, if the browser is
+ * buggy and caches old URLs.
+ *
+ * @param Horde_Url|string $url The URL to modify.
+ *
+ * @return Horde_Url The requested URL.
+ */
+ static public function nocacheUrl($url)
+ {
+ if (!$url instanceof Horde_Url) {
+ $url = new Horde_Url($url);
+ }
+
+ /* We may need to set a dummy parameter 'nocache' since some
+ * browsers do not always honor the 'no-cache' header. */
+ if ($GLOBALS['browser']->hasQuirk('cache_same_url')) {
+ $url->add('nocache', uniqid());
+ }
+
+ return $url;
+ }
+
+ /**
* Constructs a correctly-pathed link to an image.
*
* @param string $src The image file.
<api>beta</api>
</stability>
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Remove dependency on Horde_DOM package.
+ <notes>* Add Horde::nocacheUrl().
+ * Remove dependency on Horde_DOM package.
* Added Horde_Registry_Api:: and Horde_Registry_Application:: classes.
* Moved Horde_Exception to Exception package.
* Renamed Menu:: as Horde_Menu::.
);
/**
- * Random number for nocacheUrl().
- *
- * @var integer.
- */
- static protected $_randnum = null;
-
- /**
* TODO
*/
static protected $_magicquotes = null;
}
/**
- * Returns a url with the 'nocache' parameter added, if the browser is
- * buggy and caches old URLs.
- *
- * @param Horde_Url|string $url The URL to modify.
- * @param boolean $encode Encode the argument separator?
- *
- * @return string The requested URL.
- */
- static public function nocacheUrl($url, $encode = true)
- {
- /* We may need to set a dummy parameter 'nocache' since some
- * browsers do not always honor the 'no-cache' header. */
- if ($GLOBALS['browser']->hasQuirk('cache_same_url')) {
- if (is_null(self::$_randnum)) {
- self::$_randnum = base_convert(microtime(), 10, 36);
- }
- return self::addParameter($url, 'nocache', self::$_randnum, $encode);
- }
-
- return $url;
- }
-
- /**
* Returns a hidden form input containing the session name and id.
*
* @param boolean $append_session 0 = only if needed, 1 = always.
<api>beta</api>
</stability>
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Added Horde_Util::convertToUtf8().
+ <notes>* Removed Horde_Util::closeWindowJs() and Horde_Util::nocacheUrl().
+ * Added Horde_Util::convertToUtf8().
* Added Horde_Util::abbreviate().
* Removed Horde_Array::combine() and Horde_Util::hmac().
* Initial Horde 4 package.
<name>PEAR</name>
<channel>pear.php.net</channel>
</package>
- <package>
- <name>Browser</name>
- <channel>pear.horde.org</channel>
- </package>
<extension>
<name>iconv</name>
</extension>
}
if ($conf['user']['allow_folders']) {
- $menu->add(Horde_Util::nocacheUrl(Horde::applicationUrl('folders.php')), _("_Folders"), 'folders/folder.png');
+ $menu->add(Horde::nocacheUrl(Horde::applicationUrl('folders.php')), _("_Folders"), 'folders/folder.png');
}
if ($_SESSION['imp']['protocol'] != 'pop') {