mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Fixups
* undefined variables in Markup.js * logic error preventing screenshot uploads * bitshift by negative value in spell * and i'm pretty sure i already added an exception handler at one point
This commit is contained in:
@@ -149,6 +149,18 @@ set_error_handler(function($errNo, $errStr, $errFile, $errLine) {
|
||||
return true;
|
||||
}, E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E_STRICT));
|
||||
|
||||
set_exception_handler(function ($ex)
|
||||
{
|
||||
Util::addNote(U_GROUP_EMPLOYEE, 'EXCEPTION - '.$ex->getMessage().' @ '.$ex->getFile(). ':'.$ex->getLine()."\n".$ex->getTraceAsString());
|
||||
|
||||
if (DB::isConnectable(DB_AOWOW))
|
||||
DB::Aowow()->query('INSERT INTO ?_errors (`date`, `version`, `phpError`, `file`, `line`, `query`, `userGroups`, `message`) VALUES (UNIX_TIMESTAMP(), ?d, ?d, ?, ?d, ?, ?d, ?) ON DUPLICATE KEY UPDATE `date` = UNIX_TIMESTAMP()',
|
||||
AOWOW_REVISION, $ex->getCode(), $ex->getFile(), $ex->getLine(), CLI ? 'CLI' : $_SERVER['QUERY_STRING'], User::$groups, $ex->getMessage()
|
||||
);
|
||||
|
||||
(new GenericPage(null))->error();
|
||||
});
|
||||
|
||||
|
||||
$secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || (!empty($AoWoWconf['aowow']) && CFG_FORCE_SSL);
|
||||
if (defined('CFG_STATIC_HOST')) // points js to images & scripts
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('invalid access');
|
||||
die('illegal access');
|
||||
|
||||
/*
|
||||
this is just a skeleton for now
|
||||
|
||||
@@ -107,7 +107,7 @@ class ScreenshotPage extends GenericPage
|
||||
{
|
||||
$this->imgHash = Util::createHash(16);
|
||||
|
||||
if (User::canUploadScreenshot())
|
||||
if (!User::canUploadScreenshot())
|
||||
{
|
||||
$_SESSION['error']['ss'] = Lang::screenshot('error', 'notAllowed');
|
||||
return false;
|
||||
|
||||
@@ -1888,7 +1888,7 @@ class SpellPage extends GenericPage
|
||||
case 147: // Mechanic Immunity Mask
|
||||
$_ = [];
|
||||
foreach (Lang::game('me') as $k => $str)
|
||||
if ($effMV & (1 << $k - 1))
|
||||
if ($k && ($effMV & (1 << $k - 1)))
|
||||
$_[] = $str;
|
||||
|
||||
if ($_ = implode(', ', $_))
|
||||
@@ -1968,7 +1968,7 @@ class SpellPage extends GenericPage
|
||||
case 180: // Mod Spell Damage Versus
|
||||
$_ = [];
|
||||
foreach (Lang::game('ct') as $k => $str)
|
||||
if ($effMV & (1 << $k - 1))
|
||||
if ($k && ($effMV & (1 << $k - 1)))
|
||||
$_[] = $str;
|
||||
|
||||
if ($_ = implode(', ', $_))
|
||||
|
||||
@@ -223,7 +223,7 @@ var Markup = {
|
||||
var ach = g_achievements[id];
|
||||
return '<a href="' + url + '?achievement=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/wow/icons/tiny/' + ach.icon.toLowerCase() + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(ach[nameCol]) + '</span></a>';
|
||||
}
|
||||
return '<a href="' + url + '?achievement=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + Markup._addGlobalAttributes(attr) + '>' + (tempname ? tempname : ('(' + LANG.types[10][0] + ' #' + l + ')')) + '</a>';
|
||||
return '<a href="' + url + '?achievement=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + Markup._addGlobalAttributes(attr) + '>' + (tempname ? tempname : ('(' + LANG.types[10][0] + ' #' + id + ')')) + '</a>';
|
||||
},
|
||||
toText: function(attr)
|
||||
{
|
||||
@@ -1214,7 +1214,7 @@ var Markup = {
|
||||
str += Markup._safeHtml(item[nameCol]) + '</span></a>';
|
||||
return str;
|
||||
}
|
||||
return '<a href="' + url + '?item=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + (tempname ? tempname : ('(' + LANG.types[3][0] + ' #' + c + ')')) + '</a>';
|
||||
return '<a href="' + url + '?item=' + id + '"' + Markup._addGlobalAttributes(attr) + '>' + (tempname ? tempname : ('(' + LANG.types[3][0] + ' #' + id + ')')) + '</a>';
|
||||
},
|
||||
toText: function(attr)
|
||||
{
|
||||
@@ -2531,7 +2531,7 @@ var Markup = {
|
||||
return '<a href="' + url + '?spell=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/wow/icons/tiny/' + spell.icon.toLowerCase() + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(spell[nameCol]) + '</span></a>';
|
||||
}
|
||||
|
||||
return '<a href="' + url + '?spell=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + '>' + (tempname ? tempname : ('(' + LANG.types[6][0] + ' #' + f + ')')) + '</a>';
|
||||
return '<a href="' + url + '?spell=' + id + '"' + (rel.length ? ' rel="' + rel.join('&') + '"' : '') + '>' + (tempname ? tempname : ('(' + LANG.types[6][0] + ' #' + id + ')')) + '</a>';
|
||||
},
|
||||
toText: function(attr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user