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

Krystian Szymukowicz t33k at prolabium.com
Thu Dec 9 11:31:16 CET 2010


W dniu 2010-12-07 19:26, Jeff Segars pisze:
> 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?
>

Yes you right with this leading slash. My bad - I saw icon in FF and and 
did not check the generated code. So FF showed the icon despite not 
correct path. Sorry for that oversight,

So I created v3 of the path with your suggested code which works as 
should and looks much cleaner.


As for other places in core where such str_replaces are done. I would be 
glad to prepare pathes for that. Do you think it should be one patch for 
all changed files or each such place with separate patch?


As for background. This problem with PATH_site = /  touches all TYPO3 
users of a a very big hoster in west and central europe. They claim to 
have more than 1.000.000 accounts and did not want to do anything about 
changing the root of a page to other value than "/".
So this is real problem and touches lot of people here.


PS: I though about this after creating the v3 paches. What if the 
PATH_site have some special chars. Should not we use mb_substr and 
mb_strlen instead of substr and strlen ?


-- 
grtz
Krystian Szymukowicz
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 16216_v3.patch
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101209/baf65be1/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 16216_v3_44.patch
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101209/baf65be1/attachment.txt>


More information about the TYPO3-team-core mailing list