//*************************************************************************
function readShortMailboxName($haystack, $needle) {
if ($needle == '') return $haystack;
- if ($needle == '.') $needle = '\.';
+ if ($needle == '.') $needle = '\\.';
ereg("([^$needle]+)$needle?$", $haystack, $regs);
return $regs[1];
}
// of the $haystack is reached. $needle is a single character
//*************************************************************************
function readMailboxParent($haystack, $needle) {
- if ($needle == '.') $needle = '\.';
+ if ($needle == '.') $needle = '\\.';
ereg("^(.+)$needle([^$needle]+)$needle?$", $haystack, $regs);
return $regs[1];
}
// Specifically, ' comes up as 5 characters instead of 1.
// This should not add newlines to the end of lines.
function sqWordWrap(&$line, $wrap) {
- preg_match("/^([\s>]*)([^\s>].*)?$/", $line, $regs);
+ preg_match('/^([\\s>]*)([^\\s>].*)?$/', $line, $regs);
$beginning_spaces = $regs[1];
if (isset($regs[2])) {
$words = explode(' ', $regs[2]);
// Go to the next line if we have more to process
if ($i < count($words)) {
- $line .= "\n$beginning_spaces";
+ $line .= "\n" . $beginning_spaces;
}
}
}
$PreviousSpaces = "";
for ($i = 0; $i < count($lines); $i ++)
{
- preg_match("/^([\s>]*)([^\s>].*)?$/", $lines[$i], $regs);
+ preg_match('/^([\\s>]*)([^\\s>].*)?$/', $lines[$i], $regs);
$CurrentSpaces = $regs[1];
if (isset($regs[2]))
$CurrentRest = $regs[2];
return array();
$text = str_replace(' ', '', $text);
$text = ereg_replace('"[^"]*"', '', $text);
- $text = ereg_replace("\([^\)]*\)", '', $text);
+ $text = ereg_replace('\\([^\\)]*\\)', '', $text);
$text = str_replace(',', ';', $text);
$array = explode(';', $text);
for ($i = 0; $i < count ($array); $i++) {
function find_mailbox_name ($mailbox) {
-/*
- $mailbox = trim($mailbox);
- if (substr($mailbox, strlen($mailbox)-1, strlen($mailbox)) == '"') {
- $mailbox = substr($mailbox, 0, strlen($mailbox) - 1);
- $pos = strrpos ($mailbox, '"')+1;
- $box = substr($mailbox, $pos);
- } else {
- $box = substr($mailbox, strrpos($mailbox, ' ')+1, strlen($mailbox));
- }
- return $box;
-*/
-
if (ereg(" *\"([^\r\n\"]*)\"[ \r\n]*$", $mailbox, $regs))
return $regs[1];
ereg(" *([^ \r\n\"]*)[ \r\n]*$",$mailbox,$regs);
$Str = '';
foreach ($dat as $k => $v)
{
- $Str .= "$k = $v\n";
+ $Str .= $k . $v;
}
sq_mt_seed(md5($Str));
}
function sqCheckPHPVersion($major, $minor, $release) {
$ver = phpversion();
- eregi("^([0-9]+)\.([0-9]+)(.*)", $ver, $regs);
+ eregi('^([0-9]+)\\.([0-9]+)(.*)', $ver, $regs);
// Parse the version string
$vmajor = strval($regs[1]);