Bug #21865 » htmlmail_sql_regcase_patch.patch
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_regcase')) {
|
||
$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
|