Project

General

Profile

Actions

Feature #63960

closed

Use of pageNotFoundAndExit is better than simple "die"

Added by Christian Finkemeier almost 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2014-12-17
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.3
Tags:
Complexity:
easy
Sprint Focus:

Description

There are several die calls in the tslib_fe class, e.g. in the jumpurl section. For a better usability this calls should be replaced by calling the pageNotFoundAndExit method, in order to display a correct error page.

File typo3/sysext/cms/tslib/class.tslib_fe.php:

line 1779-1781
-            } else die(htmlspecialchars('Request URL did not match "'.t3lib_div::getIndpEnv('TYPO3_SITE_URL').'index.php?ADMCMD_prev='.$inputCode.'"'));    // This check is to prevent people from setting additional GET vars via realurl or other URL path based ways of passing parameters.
+            } else $this->pageNotFoundAndExit(htmlspecialchars('Request URL did not match "'.t3lib_div::getIndpEnv('TYPO3_SITE_URL').'index.php?ADMCMD_prev='.$inputCode.'"'));    // This check is to prevent people from setting additional GET vars via realurl or other URL path based ways of passing parameters.
-        } else die('POST requests are incompatible with keyword preview.');
+        } else $this->pageNotFoundAndExit('POST requests are incompatible with keyword preview.');
-    } else die('ADMCMD command could not be executed! (No keyword configuration found)');
+    } else $this->pageNotFoundAndExit('ADMCMD command could not be executed! (No keyword configuration found)');

line 1800
-    } else die('Error in preview configuration.');
+    } else $this->pageNotFoundAndExit('Error in preview configuration.');

line 2728-2731
-                } else die('jumpurl Secure: "'.$this->jumpurl.'" was not a valid file!');
+                } else $this->pageNotFoundAndExit('jumpurl Secure: "'.$this->jumpurl.'" was not a valid file!');
-            } else die('jumpurl Secure: The requested file was not allowed to be accessed through jumpUrl (path or file not allowed)!');
+            } else $this->pageNotFoundAndExit('jumpurl Secure: The requested file was not allowed to be accessed through jumpUrl (path or file not allowed)!');
-        } else die('jumpurl Secure: locationData, '.$locationData.', was not accessible.');
+        } else $this->pageNotFoundAndExit('jumpurl Secure: locationData, '.$locationData.', was not accessible.');
-    } else die('jumpurl Secure: Calculated juHash did not match the submitted juHash.');
+    } else $this->pageNotFoundAndExit('jumpurl Secure: Calculated juHash did not match the submitted juHash.');

Actions

Also available in: Atom PDF