Created
June 11, 2016 15:12
-
-
Save christianhaendel/e2d5bacd733aec6d491ec36a8d00c61d to your computer and use it in GitHub Desktop.
Revisions
-
t3agent revised this gist
Jun 11, 2016 . No changes.There are no files selected for viewing
-
t3agent created this gist
Jun 11, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ <?php class user_pageNotFound { function pageNotFound($params,$tsfeObj) { global $TYPO3_CONF_VARS; $url = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL').'index.php?id='.$TYPO3_CONF_VARS['EXTCONF']['realurl'][\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('HTTP_HOST')]['errorPage']; $_buffer = $this->loadPage($url); echo $_buffer; } function loadPage($url) { $agent = "TYPO3 pageNotFoundFunction v1.0"; $header[] = "Accept: text/vnd.wap.wml,*.*"; $ch = curl_init($url); if ($ch) { curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $tmp = curl_exec($ch); if(FALSE == $tmp) { print_r(curl_error($ch)); } curl_close($ch); } return $tmp; } } ?>