Bug #17899 » patch_02.diff
class.t3lib_parsehtml.php 2007-12-08 12:05:41.000000000 +0100 | ||
---|---|---|
* @param string Alternative less-than char to replace with (replace regex string)
|
||
* @return string Processed HTML content
|
||
*/
|
||
function mapTags($value,$tags=array(),$ltChar='<',$ltChar2='<') {
|
||
function mapTags($value,$tags=array(),$ltChar='<',$ltChar2='<',$preserveAttribs=false) {
|
||
foreach($tags as $from => $to) {
|
||
$value = preg_replace('/'.preg_quote($ltChar).'(\/)?'.$from.'\s([^\>])*(\/)?\>/', $ltChar2.'$1'.$to.' $2$3>', $value);
|
||
$value = preg_replace('/'.preg_quote($ltChar).'(\/)?'.$from.'(\s[^\>\/]*)?(\/)?\>/', $ltChar2.'$1'.$to.($preserveAttribs?'$2$3>':'$3>'), $value);
|
||
}
|
||
return $value;
|
||
}
|
- « Previous
- 1
- 2
- Next »