[TYPO3-core] Bug #1343: Minor problem with tslib_fe::prefixLocalAnchorsWithScript()

Michael Stucki michael at typo3.org
Mon Dec 12 21:42:52 CET 2005


Hi Sebastian,

> Description:
> prefixLocalAnchorsWithScript does only work correctly if the href
> attribute is the first attribute of an a or area tag. This is a problem
> e.g. when using qcom_htmlcleaner which will eventually change the order
> of html attributes (which should not matter at all).
> 
> Solution:
>       * changed ereg to preg
>       * made it work correctly
>       * tested the new regExp

Makes sense, but:

$this->content = preg_replace('/(<(a|area).*?href=")(#[^"]*")/i','\\1' .
htmlspecialchars($scriptPath) . '\\3',$this->content);

1. What is the idea behind the question mark left to "href"? I don't think
this makes sense.

2. You can use "$1" instead of the "\\1" etc.

- michael
-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/



More information about the TYPO3-team-core mailing list