projects
/
squirrelmail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated the themes, and general SquirrelMail stuff
[squirrelmail.git]
/
functions
/
strings.php
diff --git
a/functions/strings.php
b/functions/strings.php
index 348b62d75516995bd926ddd91e125d847046b725..66cd5de8d562f45f1d26d527163af7cb19056b61 100644
(file)
--- a/
functions/strings.php
+++ b/
functions/strings.php
@@
-1,4
+1,5
@@
<?
<?
+
//*************************************************************************
// Count the number of occurances of $needle are in $haystack.
//*************************************************************************
//*************************************************************************
// Count the number of occurances of $needle are in $haystack.
//*************************************************************************
@@
-16,15
+17,13
@@
// of the $haystack is reached.
//*************************************************************************
function readShortMailboxName($haystack, $needle) {
// of the $haystack is reached.
//*************************************************************************
function readShortMailboxName($haystack, $needle) {
- $len = strlen($haystack);
- for ($i = $len - 1; ($i >= 0) && (!$found);$i--) {
- $char = $haystack[$i];
- if ($char == $needle)
- $found = 1;
- else
- $data .= $char;
+ if (strpos($haystack, $needle)) {
+ $pos = strrpos($haystack, $needle) + 1;
+ $data = substr($haystack, $pos, strlen($haystack));
+ } else {
+ $data = $haystack;
}
}
- return
strrev($data)
;
+ return
$data
;
}
// Wraps text at $wrap characters
}
// Wraps text at $wrap characters
@@
-77,4
+76,7
@@
}
return $to_line;
}
}
return $to_line;
}
+
+ /* SquirrelMail version number -- DO NOT CHANGE */
+ $version = "0.2";
?>
?>