Hi,

but the case described by you is the reason why you should use BOOLEAN.
in my case it is int(0) and with your logic the resulting url looks like:

http://my-doamain.tld/http://my-domain.tld/service.html#09220

when test against BOOLEAN everything works fine.


Von: Claus Due <notifications@github.com<mailto:notifications@github.com>>
Antworten an: FluidTYPO3/vhs <reply@reply.github.com<mailto:reply@reply.github.com>>
Datum: Dienstag, 3. Juni 2014 16:19
An: FluidTYPO3/vhs <vhs@noreply.github.com<mailto:vhs@noreply.github.com>>
Cc: Michael Staatz <michael.staatz@gdata.de<mailto:michael.staatz@gdata.de>>
Betreff: Re: [vhs] [BUGFIX] The function "strpos" may return Boolean FALSE (#597)


In Classes/ViewHelpers/Page/AbsoluteUrlViewHelper.php:

> @@ -37,7 +37,7 @@ class Tx_Vhs_ViewHelpers_Page_AbsoluteUrlViewHelper extends \TYPO3\CMS\Fluid\Cor
>        */
>       public function render() {
>               $url = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL');
> -             if (0 === strpos($url, \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'))) {
> +             if (FALSE === strpos($url, \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'))) {


Should be 0 !== strpos(...) since the site's URL may be contained in the request URL at an index other than zero, in which case the return is not FALSE but an integer - but the ENV variable should still be prefixed in such a case which it is not if the check is for FALSE.

—
Reply to this email directly or view it on GitHub<https://github.com/FluidTYPO3/vhs/pull/597/files#r13336411>.

____________
Virus checked by G Data MailSecurity
Version: AVA 24.2458 dated 03.06.2014
Virus news: www.antiviruslab.com