From: pdontthink Date: Wed, 7 Dec 2005 05:57:06 +0000 (+0000) Subject: Move sqm_baseuri() to strings.php. A file for functions that manipulate strings... X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=a9a7cda1e186f13501bd2d59a28c0763f16f2f96 Move sqm_baseuri() to strings.php. A file for functions that manipulate strings isn't a good dumping ground for this stuff, but get_location() is already there, and otherwise we'd need more reorg that I'm not doing now. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10438 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/display_messages.php b/functions/display_messages.php index 470a5d35..37ab2613 100644 --- a/functions/display_messages.php +++ b/functions/display_messages.php @@ -20,29 +20,6 @@ if (! defined('SM_PATH')) define('SM_PATH','../'); */ include_once(SM_PATH . 'functions/plugin.php'); -/** - * Find out where SquirrelMail lives and try to be smart about it. - * The only problem would be when SquirrelMail lives in directories - * called "src", "functions", or "plugins", but people who do that need - * to be beaten with a steel pipe anyway. - * - * @return string the base uri of SquirrelMail installation. - * @since 1.2.6 - */ -function sqm_baseuri(){ - global $base_uri, $PHP_SELF; - /** - * If it is in the session, just return it. - */ - if (isset($base_uri)){ - return $base_uri; - } - $dirs = array('|src/.*|', '|plugins/.*|', '|functions/.*|'); - $repl = array('', '', ''); - $base_uri = preg_replace($dirs, $repl, $PHP_SELF); - return $base_uri; -} - /** * Displays error message and URL to message listing * @param string $message error message @@ -219,4 +196,4 @@ function error_option_save($message) { $optpage_save_error=array_merge($optpage_save_error,array($message)); } // vim: et ts=4 -?> \ No newline at end of file +?> diff --git a/functions/strings.php b/functions/strings.php index df511b32..f4e76554 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -477,6 +477,29 @@ function readShortMailboxName($haystack, $needle) { return( $elem ); } +/** + * Find out where SquirrelMail lives and try to be smart about it. + * The only problem would be when SquirrelMail lives in directories + * called "src", "functions", or "plugins", but people who do that need + * to be beaten with a steel pipe anyway. + * + * @return string the base uri of SquirrelMail installation. + * @since 1.2.6 + */ +function sqm_baseuri(){ + global $base_uri, $PHP_SELF; + /** + * If it is in the session, just return it. + */ + if (isset($base_uri)){ + return $base_uri; + } + $dirs = array('|src/.*|', '|plugins/.*|', '|functions/.*|'); + $repl = array('', '', ''); + $base_uri = preg_replace($dirs, $repl, $PHP_SELF); + return $base_uri; +} + /** * get_location * @@ -1298,4 +1321,4 @@ function sq_count8bit($string) { return $count; } -?> \ No newline at end of file +?>