* try to die a bit more gracefull if errors occur
This commit is contained in:
Sarjuuk
2017-03-21 02:58:16 +01:00
parent 62a95effb8
commit 00de81c60d
27 changed files with 35 additions and 31 deletions

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
class AjaxHandler class AjaxHandler

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
class AjaxAccount extends AjaxHandler class AjaxAccount extends AjaxHandler
{ {

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
class AjaxAdmin extends AjaxHandler class AjaxAdmin extends AjaxHandler
{ {

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
class AjaxComment extends AjaxHandler class AjaxComment extends AjaxHandler
{ {

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
class AjaxContactus extends AjaxHandler class AjaxContactus extends AjaxHandler
{ {

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
class AjaxCookie extends AjaxHandler class AjaxCookie extends AjaxHandler
{ {

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
class AjaxData extends AjaxHandler class AjaxData extends AjaxHandler
{ {

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
class AjaxGotocomment extends AjaxHandler class AjaxGotocomment extends AjaxHandler
{ {

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
class AjaxLocale extends AjaxHandler class AjaxLocale extends AjaxHandler
{ {

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
class AjaxProfile extends AjaxHandler class AjaxProfile extends AjaxHandler
{ {

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
/* /*
* Page * Page

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
/* from TC wiki /* from TC wiki

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
class SimpleXML extends SimpleXMLElement class SimpleXML extends SimpleXMLElement

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
// tabId 1: Tools g_initHeader() // tabId 1: Tools g_initHeader()

View File

@@ -480,6 +480,7 @@ class GenericPage
$this->articleUrl = 'page-not-found'; $this->articleUrl = 'page-not-found';
$this->title[] = Lang::main('errPageTitle'); $this->title[] = Lang::main('errPageTitle');
$this->name = Lang::main('errPageTitle'); $this->name = Lang::main('errPageTitle');
$this->lvTabs = [];
$this->addArticle(); $this->addArticle();
@@ -521,7 +522,10 @@ class GenericPage
$this->prepareContent(); $this->prepareContent();
if (!$this->isSaneInclude('template/pages/', $this->tpl)) if (!$this->isSaneInclude('template/pages/', $this->tpl))
die(User::isInGroup(U_GROUP_EMPLOYEE) ? 'Error: nonexistant template requested: template/pages/'.$this->tpl.'.tpl.php' : null); {
trigger_error('Error: nonexistant template requested: template/pages/'.$this->tpl.'.tpl.php', E_USER_ERROR);
$this->error();
}
$this->addAnnouncements(); $this->addAnnouncements();
@@ -584,7 +588,7 @@ class GenericPage
$$n = $v; $$n = $v;
if (!$this->isSaneInclude('template/bricks/', $file)) if (!$this->isSaneInclude('template/bricks/', $file))
trigger_error("Nonexistant template requested: template/bricks/".$file.".tpl.php"); trigger_error('Nonexistant template requested: template/bricks/'.$file.'.tpl.php', E_USER_ERROR);
else else
include('template/bricks/'.$file.'.tpl.php'); include('template/bricks/'.$file.'.tpl.php');
} }
@@ -592,7 +596,7 @@ class GenericPage
public function lvBrick($file) // load listview addIns public function lvBrick($file) // load listview addIns
{ {
if (!$this->isSaneInclude('template/listviews/', $file)) if (!$this->isSaneInclude('template/listviews/', $file))
trigger_error('Nonexistant Listview addin requested: template/listviews/'.$file.'.tpl.php'); trigger_error('Nonexistant Listview addin requested: template/listviews/'.$file.'.tpl.php', E_USER_ERROR);
else else
include('template/listviews/'.$file.'.tpl.php'); include('template/listviews/'.$file.'.tpl.php');
} }
@@ -602,7 +606,7 @@ class GenericPage
if (!$this->isSaneInclude('template/localized/', $file.'_'.$loc)) if (!$this->isSaneInclude('template/localized/', $file.'_'.$loc))
{ {
if ($loc == LOCALE_EN || !$this->isSaneInclude('template/localized/', $file.'_'.LOCALE_EN)) if ($loc == LOCALE_EN || !$this->isSaneInclude('template/localized/', $file.'_'.LOCALE_EN))
trigger_error("Nonexistant template requested: template/localized/".$file.'_'.$loc.".tpl.php"); trigger_error('Nonexistant template requested: template/localized/'.$file.'_'.$loc.'.tpl.php', E_USER_ERROR);
else else
include('template/localized/'.$file.'_'.LOCALE_EN.'.tpl.php'); include('template/localized/'.$file.'_'.LOCALE_EN.'.tpl.php');
} }

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
// !do not cache! // !do not cache!
/* older version /* older version

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
/* /*

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
if (!CLI) if (!CLI)
die('not in cli mode'); die('not in cli mode');

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
if (!CLI) if (!CLI)
die('not in cli mode'); die('not in cli mode');

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
if (!CLI) if (!CLI)
die('not in cli mode'); die('not in cli mode');

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
if (!CLI) if (!CLI)
die('not in cli mode'); die('not in cli mode');

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
if (!CLI) if (!CLI)
die('not in cli mode'); die('not in cli mode');

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
if (!CLI) if (!CLI)
die('not in cli mode'); die('not in cli mode');

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
if (!CLI) if (!CLI)
die('not in cli mode'); die('not in cli mode');

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
if (!CLI) if (!CLI)
die('not in cli mode'); die('not in cli mode');

View File

@@ -1,7 +1,7 @@
<?php <?php
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('illegal access');
if (!CLI) if (!CLI)
die('not in cli mode'); die('not in cli mode');

View File

@@ -30,7 +30,7 @@ if (!CLI)
else // expected file.mp3.mp3 else // expected file.mp3.mp3
$filePath .= '.mp3'; $filePath .= '.mp3';
// just use the first locale available .. i there is no support for multiple audio files anyway // just use the first locale available .. there is no support for multiple audio files anyway
foreach (CLISetup::$expectedPaths as $locStr => $__) foreach (CLISetup::$expectedPaths as $locStr => $__)
{ {
// get your paths straight! // get your paths straight!
@@ -43,7 +43,7 @@ if (!CLI)
{ {
$ok = false; $ok = false;
CLISetup::log(' - could not copy '.CLISetup::bold($p).' into '.CLISetup::bold('static/wowsounds/'.$fileId), CLISetup::LOG_ERROR); CLISetup::log(' - could not copy '.CLISetup::bold($p).' into '.CLISetup::bold('static/wowsounds/'.$fileId), CLISetup::LOG_ERROR);
die(); break 2;
} }
continue 2; continue 2;