* $Id$
*/
-require_once(SM_PATH . 'functions/global.php');
/**
* SquirrelMail version number -- DO NOT CHANGE
*/
global $version;
-$version = '1.4.0';
+$version = '1.5.0 [CVS]';
/**
* SquirrelMail internal version number -- DO NOT CHANGE
* $sm_internal_version = array (release, major, minor)
*/
global $SQM_INTERNAL_VERSION;
-$SQM_INTERNAL_VERSION = array(1,4,0);
+$SQM_INTERNAL_VERSION = array(1,5,0);
+
+/**
+ * There can be a circular issue with includes, where the $version string is
+ * referenced by the include of global.php, etc. before it's defined.
+ * For that reason, bring in global.php AFTER we define the version strings.
+ */
+require_once(SM_PATH . 'functions/global.php');
/**
* Wraps text at $wrap characters
return( $elem );
}
-/**
- * Returns an array of email addresses.
- * Be cautious of "user@host.com"
- */
-function parseAddrs($text) {
- if (trim($text) == '')
- return array();
- $text = str_replace(' ', '', $text);
- $text = ereg_replace('"[^"]*"', '', $text);
- $text = ereg_replace('\\([^\\)]*\\)', '', $text);
- $text = str_replace(',', ';', $text);
- $array = explode(';', $text);
- for ($i = 0; $i < count ($array); $i++) {
- $array[$i] = eregi_replace ('^.*[<]', '', $array[$i]);
- $array[$i] = eregi_replace ('[>].*$', '', $array[$i]);
- }
- return $array;
-}
-
-/**
- * Returns a line of comma separated email addresses from an array.
- */
-function getLineOfAddrs($array) {
- if (is_array($array)) {
- $to_line = implode(', ', $array);
- $to_line = ereg_replace(', (, )+', ', ', $to_line);
- $to_line = trim(ereg_replace('^, ', '', $to_line));
- if( substr( $to_line, -1 ) == ',' )
- $to_line = substr( $to_line, 0, -1 );
- } else {
- $to_line = '';
- }
-
- return( $to_line );
-}
-
function php_self () {
if ( sqgetGlobalVar('REQUEST_URI', $req_uri, SQ_SERVER) && !empty($req_uri) ) {
return $req_uri;
}
}
-/**
- * Removes slashes from every element in the array
- */
-function RemoveSlashes(&$array) {
- foreach ($array as $k => $v) {
- global $$k;
- if (is_array($$k)) {
- foreach ($$k as $k2 => $v2) {
- $newArray[stripslashes($k2)] = stripslashes($v2);
- }
- $$k = $newArray;
- } else {
- $$k = stripslashes($v);
- }
-
- /* Re-assign back to the array. */
- $array[$k] = $$k;
- }
-}
-
$PHP_SELF = php_self();
?>