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;
|
return true;
|
||||||
}, E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E_STRICT));
|
}, 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);
|
$secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || (!empty($AoWoWconf['aowow']) && CFG_FORCE_SSL);
|
||||||
if (defined('CFG_STATIC_HOST')) // points js to images & scripts
|
if (defined('CFG_STATIC_HOST')) // points js to images & scripts
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (!defined('AOWOW_REVISION'))
|
if (!defined('AOWOW_REVISION'))
|
||||||
die('invalid access');
|
die('illegal access');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
this is just a skeleton for now
|
this is just a skeleton for now
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class ScreenshotPage extends GenericPage
|
|||||||
{
|
{
|
||||||
$this->imgHash = Util::createHash(16);
|
$this->imgHash = Util::createHash(16);
|
||||||
|
|
||||||
if (User::canUploadScreenshot())
|
if (!User::canUploadScreenshot())
|
||||||
{
|
{
|
||||||
$_SESSION['error']['ss'] = Lang::screenshot('error', 'notAllowed');
|
$_SESSION['error']['ss'] = Lang::screenshot('error', 'notAllowed');
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1888,7 +1888,7 @@ class SpellPage extends GenericPage
|
|||||||
case 147: // Mechanic Immunity Mask
|
case 147: // Mechanic Immunity Mask
|
||||||
$_ = [];
|
$_ = [];
|
||||||
foreach (Lang::game('me') as $k => $str)
|
foreach (Lang::game('me') as $k => $str)
|
||||||
if ($effMV & (1 << $k - 1))
|
if ($k && ($effMV & (1 << $k - 1)))
|
||||||
$_[] = $str;
|
$_[] = $str;
|
||||||
|
|
||||||
if ($_ = implode(', ', $_))
|
if ($_ = implode(', ', $_))
|
||||||
@@ -1968,7 +1968,7 @@ class SpellPage extends GenericPage
|
|||||||
case 180: // Mod Spell Damage Versus
|
case 180: // Mod Spell Damage Versus
|
||||||
$_ = [];
|
$_ = [];
|
||||||
foreach (Lang::game('ct') as $k => $str)
|
foreach (Lang::game('ct') as $k => $str)
|
||||||
if ($effMV & (1 << $k - 1))
|
if ($k && ($effMV & (1 << $k - 1)))
|
||||||
$_[] = $str;
|
$_[] = $str;
|
||||||
|
|
||||||
if ($_ = implode(', ', $_))
|
if ($_ = implode(', ', $_))
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ var Markup = {
|
|||||||
var ach = g_achievements[id];
|
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('&') + '"' : '') + (!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)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
@@ -1214,7 +1214,7 @@ var Markup = {
|
|||||||
str += Markup._safeHtml(item[nameCol]) + '</span></a>';
|
str += Markup._safeHtml(item[nameCol]) + '</span></a>';
|
||||||
return str;
|
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)
|
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('&') + '"' : '') + (!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)
|
toText: function(attr)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user