--- class.t3lib_parsehtml.php 2007-10-22 02:26:45.000000000 +0200
+++ class.t3lib_parsehtml.php 2007-12-08 12:05:41.000000000 +0100
@@ -964,10 +964,10 @@
* @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;
}