Project

General

Profile

Bug #21865 » htmlmail_sql_regex_patch.patch

Administrator Admin, 2009-12-18 12:29

View differences:

class.t3lib_htmlmail.php (working copy)
$c = count($tags);
foreach($tags as $tag) {
$c--;
$regexp .= '<' . sql_regcase($tag) . "[[:space:]]" . (($c) ? '|' : '');
$regexp .= '<' . $this->sql_regcase($tag) . "[[:space:]]" . (($c) ? '|' : '');
}
return $regexp . '/';
}
/**
* replacing the deprecated function sql_regex for php 5.3
*
* @param string $string
* @param string $encoding
* @return string regex
*/
private function sql_regcase($string,$encoding='auto'){
$ret = '';
if (function_exists('sql_regex')) {
$ret = sql_regcase($tag);
} else {
$max=mb_strlen($item,$encoding);
for ($i = 0; $i < $max; $i++) {
$char=mb_substr($item,$i,1,$encoding);
$up=mb_strtoupper ($char,$encoding);
$low=mb_strtolower($char,$encoding);
$ret.=($up!=$low)?'['.$up.$low.']' : $char;
}
}
return $ret;
}
/**
* This function analyzes a HTML tag
(1-1/5)