diff options
| author | 2021-02-05 21:59:21 +0100 | |
|---|---|---|
| committer | 2021-02-05 21:59:21 +0100 | |
| commit | 934f032c19ba0ae16a4d19702c8e95c377f64c14 (patch) | |
| tree | db893d48f850e2a6e2dacfb9b57bbe1b9e4c8dbb /lib/Minz | |
| parent | 0577bc772bb28b3bda0f33b184c79aa226e606ca (diff) | |
Better error message on failure (#3407)
* bump default logout from 30 to 365 days
* * Change cookie duration to constant
* Change cookie duration to three months
* use class
* use 90 days (otherwise login form says 91.3 days)
* change class
* also this works now
* Better error message
* inconsistent dot with the other message
* Better error message
* add errorMessage()
* fix style
* html escape the error title
* also html escape error message
* remove spaces before parentheses
* rework the error message
* Minz-friendly
* Update message
Do not advise running this script as wrong user
* Update lib/lib_rss.php
Co-authored-by: Martin <spleefer90@gmail.com>
Co-authored-by: Martin Rys <martin@rys.pw>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'lib/Minz')
| -rw-r--r-- | lib/Minz/FrontController.php | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/lib/Minz/FrontController.php b/lib/Minz/FrontController.php index 1f67884fa..b6831c2f3 100644 --- a/lib/Minz/FrontController.php +++ b/lib/Minz/FrontController.php @@ -43,7 +43,7 @@ class Minz_FrontController { Minz_Request::forward ($url); } catch (Minz_Exception $e) { Minz_Log::error($e->getMessage()); - $this->killApp ($e->getMessage ()); + $this->killApp ($e->getMessage()); } $this->dispatcher = Minz_Dispatcher::getInstance(); @@ -54,21 +54,21 @@ class Minz_FrontController { * @return tableau représentant l'url */ private function buildUrl() { - $url = array (); + $url = array(); - $url['c'] = Minz_Request::fetchGET ( + $url['c'] = Minz_Request::fetchGET( 'c', - Minz_Request::defaultControllerName () + Minz_Request::defaultControllerName() ); - $url['a'] = Minz_Request::fetchGET ( + $url['a'] = Minz_Request::fetchGET( 'a', - Minz_Request::defaultActionName () + Minz_Request::defaultActionName() ); - $url['params'] = Minz_Request::fetchGET (); + $url['params'] = Minz_Request::fetchGET(); // post-traitement - unset ($url['params']['c']); - unset ($url['params']['a']); + unset($url['params']['c']); + unset($url['params']['a']); return $url; } @@ -76,7 +76,7 @@ class Minz_FrontController { /** * Démarre l'application (lance le dispatcher et renvoie la réponse) */ - public function run () { + public function run() { try { $this->dispatcher->run(); } catch (Minz_Exception $e) { @@ -92,11 +92,11 @@ class Minz_FrontController { $e instanceof Minz_ActionException) { Minz_Error::error ( 404, - array ('error' => array ($e->getMessage ())), + array('error' => array ($e->getMessage ())), true ); } else { - $this->killApp (); + $this->killApp(); } } } @@ -105,10 +105,11 @@ class Minz_FrontController { * Permet d'arrêter le programme en urgence */ private function killApp ($txt = '') { - if ($txt == '') { - $txt = 'See logs files'; + if (function_exists('errorMessage')) { + //If the application has defined a custom error message function + exit(errorMessage('Application problem', $txt)); } - exit ('### Application problem ###<br />'."\n".$txt); + exit('### Application problem ###<br />' . "\n" . $txt); } private function setReporting() { |
