[TYPO3-english] ' tipafriend ' suggested code to allow for tipUrl link to keep link set for detail view of record listing

Matthew K - (Swagman Solutions) typo3 at swagmansolutions.com.au
Mon May 10 03:19:31 CEST 2010


UPDATED code suggestions, (as previous post code could introduce mail 
injection therefore)...

In the following line in extension tipafriend v1.2.4 at approx line 145:

$url = $this->validateUrl(t3lib_div::_GP('tipUrl'));

a) replace with this sample code:
(the update here as compared to orig8inal post is using the function
'validateUrl' on http_referer)

if (t3lib_div::_GP('submit')!='Send') {
    $url = $this->validateUrl(t3lib_div::getIndpEnv('HTTP_REFERER'));
} else {
    $url = $this->validateUrl(t3lib_div::_GP('tipUrl'));
}

or
b) perhaps replace with this sample code:
(same as above but the conditional statement also checks for extension
'captcha' loaded)

if (t3lib_div::_GP('submit')!='Send' && t3lib_extMgm::isLoaded('captcha')) {
    $url = $this->validateUrl(t3lib_div::getIndpEnv('HTTP_REFERER'));
} else {
    $url = $this->validateUrl(t3lib_div::_GP('tipUrl'));
}



Matthew K - (Swagman Solutions) wrote:
> Hi,
>
> If anyone is using extension ' tipafriend ' and would like the tipUrl
> referral link that is emailed to recipient to keep the link set the
> detailed view of a record listing, ie tt_news single view, then here
> is some suggested code.
>
> tipafriend v1.2.3
>
> at approx line 145 find:
>
>  $url = $this->validateUrl(t3lib_div::_GP('tipUrl'));
>
>
> replace with:
>
>  if (t3lib_div::_GP('submit')!='Send') {
>   $url = t3lib_div::getIndpEnv('HTTP_REFERER');
>  } else {
>   $url = $this->validateUrl(t3lib_div::_GP('tipUrl'));
>  }
>
>
> regards
>
> Matthew K
> Swagman Solutions





More information about the TYPO3-english mailing list