[TYPO3-core] RFC #16216 Bug: taskcenter - wrongly created path for icon (in certain conditions)

Jeff Segars jsegars at alumni.rice.edu
Tue Dec 7 19:26:25 CET 2010


On 11/2/10 5:37 AM, Krystian Szymukowicz wrote:
>
> Hi,
>
> this is a SVN patch request.
>
> Type: Bugfix, almost nobrainer
>
> BT reference: http://bugs.typo3.org/view.php?id=16216
>
> Branches: 4_4, trunk
>
>
> PROBLEM:
> The path for icon in taskcenter is created wtih:
> $icon = $GLOBALS['BACK_PATH'] . '../' . str_replace(PATH_site, '',
> $absIconPath);
>
> There are some edge situations when the PATH_site is equal to "/". In
> that case the backslash from icon path will be removed and such path of
> icon generated:
> http://example.com/typo3sysextsys_actionx-sys_action.png
>
> SOLUTION:
> Check if PATH_site is "/"
>
>

Hey Krystian,
Thanks for your patch! I did a quick search through the core and found 
that similar str_replaces are done in about 10 other places. Also, it 
seems to me like there's a small issue that $absIconPath will still have 
its leading slash if PATH_site is / (since the str_replace is not done 
at all).

Would the best solution be to just remove the first instance of 
PATH_site from $absIconPath and leave the rest of the string alone. 
Maybe something like....

substr($absIconPath, strlen(PATH_site))

What do you think?

Thanks,
Jeff


More information about the TYPO3-team-core mailing list