mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
some minor error suppresants
This commit is contained in:
0
cache/template/index.html
vendored
Normal file → Executable file
0
cache/template/index.html
vendored
Normal file → Executable file
@@ -159,11 +159,12 @@ if (!CLI)
|
|||||||
|
|
||||||
define('HOST_URL', ($secure ? 'https://' : 'http://').$host);
|
define('HOST_URL', ($secure ? 'https://' : 'http://').$host);
|
||||||
define('STATIC_URL', ($secure ? 'https://' : 'http://').$host.'/static');
|
define('STATIC_URL', ($secure ? 'https://' : 'http://').$host.'/static');
|
||||||
if (User::isInGroup(U_GROUP_ADMIN) && !empty($AoWoWconf['aowow'])) // initial set
|
|
||||||
|
if (User::isInGroup(U_GROUP_ADMIN)) // initial set
|
||||||
{
|
{
|
||||||
DB::Aowow()->query('INSERT IGNORE INTO ?_config VALUES (?, ?, ?d, ?), (?, ?, ?d, ?)',
|
DB::Aowow()->query('REPLACE INTO ?_config VALUES (?a)',
|
||||||
'site_host', $host, CON_FLAG_TYPE_STRING | CON_FLAG_PERSISTENT, 'default: '.$host.' - points js to executable files (automaticly set on first run)',
|
[['site_host', $host, CON_FLAG_TYPE_STRING | CON_FLAG_PERSISTENT, 'default: '.$host.' - points js to executable files (automaticly set on first run)'],
|
||||||
'static_host', $host.'/static', CON_FLAG_TYPE_STRING | CON_FLAG_PERSISTENT, 'default: '.$host.'/static - points js to images & scripts (automaticly set on first run)'
|
['static_host', $host.'/static', CON_FLAG_TYPE_STRING | CON_FLAG_PERSISTENT, 'default: '.$host.'/static - points js to images & scripts (automaticly set on first run)']]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ class AccountPage extends GenericPage
|
|||||||
'username' => [FILTER_SANITIZE_SPECIAL_CHARS, 0xC], // FILTER_FLAG_STRIP_LOW | *_HIGH
|
'username' => [FILTER_SANITIZE_SPECIAL_CHARS, 0xC], // FILTER_FLAG_STRIP_LOW | *_HIGH
|
||||||
'password' => [FILTER_UNSAFE_RAW, null],
|
'password' => [FILTER_UNSAFE_RAW, null],
|
||||||
'c_password' => [FILTER_UNSAFE_RAW, null],
|
'c_password' => [FILTER_UNSAFE_RAW, null],
|
||||||
|
'token' => [FILTER_UNSAFE_RAW, null],
|
||||||
'remember_me' => [FILTER_CALLBACK, ['options' => 'AccountPage::rememberCallback']],
|
'remember_me' => [FILTER_CALLBACK, ['options' => 'AccountPage::rememberCallback']],
|
||||||
'email' => [FILTER_SANITIZE_EMAIL, null]
|
'email' => [FILTER_SANITIZE_EMAIL, null]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -925,7 +925,7 @@ class NpcPage extends GenericPage
|
|||||||
{
|
{
|
||||||
$nQuotes = 0;
|
$nQuotes = 0;
|
||||||
$quotes = [];
|
$quotes = [];
|
||||||
$quoteQuery = '
|
$quoteSrc = DB::World()->select('
|
||||||
SELECT
|
SELECT
|
||||||
ct.groupid AS ARRAY_KEY, ct.id as ARRAY_KEY2, ct.`type`,
|
ct.groupid AS ARRAY_KEY, ct.id as ARRAY_KEY2, ct.`type`,
|
||||||
ct.TextRange AS `range`,
|
ct.TextRange AS `range`,
|
||||||
@@ -944,9 +944,11 @@ class NpcPage extends GenericPage
|
|||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
locales_broadcast_text lbct ON ct.BroadcastTextId = lbct.ID
|
locales_broadcast_text lbct ON ct.BroadcastTextId = lbct.ID
|
||||||
WHERE
|
WHERE
|
||||||
ct.entry = ?d';
|
ct.entry = ?d',
|
||||||
|
$this->typeId
|
||||||
|
);
|
||||||
|
|
||||||
foreach (DB::World()->select($quoteQuery, $this->typeId) as $text)
|
foreach ($quoteSrc as $text)
|
||||||
{
|
{
|
||||||
$group = [];
|
$group = [];
|
||||||
foreach ($text as $t)
|
foreach ($text as $t)
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class ProfilesPage extends GenericPage
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$this->filter = ['query' => 1];
|
$this->filter = ['query' => 1, 'fi' => []];
|
||||||
|
|
||||||
|
|
||||||
Lang::sort('game', 'cl');
|
Lang::sort('game', 'cl');
|
||||||
@@ -121,12 +121,12 @@ class ProfilesPage extends GenericPage
|
|||||||
{
|
{
|
||||||
$classMask = 1 << ($this->character['classs'] - 1);
|
$classMask = 1 << ($this->character['classs'] - 1);
|
||||||
$distrib = DB::Aowow()->selectCol('SELECT COUNT(t.id) FROM dbc_talent t JOIN dbc_talenttab tt ON t.tabId = tt.id WHERE tt.classMask & ?d GROUP BY tt.id ORDER BY tt.tabNumber ASC', $classMask);
|
$distrib = DB::Aowow()->selectCol('SELECT COUNT(t.id) FROM dbc_talent t JOIN dbc_talenttab tt ON t.tabId = tt.id WHERE tt.classMask & ?d GROUP BY tt.id ORDER BY tt.tabNumber ASC', $classMask);
|
||||||
$result = [];
|
$result = [0, 0, 0];
|
||||||
|
|
||||||
$start = 0;
|
$start = 0;
|
||||||
foreach ($distrib as $len)
|
foreach ($distrib as $idx => $len)
|
||||||
{
|
{
|
||||||
$result[] = array_sum(str_split(substr($tString, $start, $len)));
|
$result[$idx] = array_sum(str_split(substr($tString, $start, $len)));
|
||||||
$start += $len;
|
$start += $len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ if (!defined('AOWOW_REVISION'))
|
|||||||
die('illegal access');
|
die('illegal access');
|
||||||
|
|
||||||
|
|
||||||
// exclude & weightscales are handled as Ajax
|
|
||||||
class UserPage extends GenericPage
|
class UserPage extends GenericPage
|
||||||
{
|
{
|
||||||
protected $tpl = 'user';
|
protected $tpl = 'user';
|
||||||
@@ -28,7 +27,10 @@ class UserPage extends GenericPage
|
|||||||
$this->notFound(sprintf(Lang::user('notFound'), $pageParam));
|
$this->notFound(sprintf(Lang::user('notFound'), $pageParam));
|
||||||
}
|
}
|
||||||
else if (User::$id)
|
else if (User::$id)
|
||||||
|
{
|
||||||
header('Location: ?user='.User::$displayName, true, 302);
|
header('Location: ?user='.User::$displayName, true, 302);
|
||||||
|
die();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
$this->forwardToSignIn('user');
|
$this->forwardToSignIn('user');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ if (!CLI)
|
|||||||
{
|
{
|
||||||
$result = null;
|
$result = null;
|
||||||
|
|
||||||
if (in_array(substr($path, -4, 4), ['.png', '.blp']))
|
if (in_array(substr($path, -4, 4), ['.png', '.blp', '.BLP', '.PNG']))
|
||||||
$path = substr($path, 0, strlen($path) - 4);
|
$path = substr($path, 0, strlen($path) - 4);
|
||||||
|
|
||||||
$file = $path.'.png';
|
$file = $path.'.png';
|
||||||
@@ -44,7 +44,7 @@ if (!CLI)
|
|||||||
if (isset(FileGen::$cliOpts['help']))
|
if (isset(FileGen::$cliOpts['help']))
|
||||||
{
|
{
|
||||||
echo "\n";
|
echo "\n";
|
||||||
echo "available Options for subScript 'simpleImg':\n";
|
echo "available options for subScript 'simpleImg':\n";
|
||||||
echo " --icons (generates square icons that are used for basicly everything)\n";
|
echo " --icons (generates square icons that are used for basicly everything)\n";
|
||||||
echo " --glyphs (decorative tidbit displayed on Infobox for Glyph Spells)\n";
|
echo " --glyphs (decorative tidbit displayed on Infobox for Glyph Spells)\n";
|
||||||
echo " --pagetexts (imagery contained in PageTexts on readable GameObjects or Items)\n";
|
echo " --pagetexts (imagery contained in PageTexts on readable GameObjects or Items)\n";
|
||||||
@@ -269,9 +269,9 @@ if (!CLI)
|
|||||||
if (isset($paths[0]) || isset($paths[1])) // generates icons or glyphs
|
if (isset($paths[0]) || isset($paths[1])) // generates icons or glyphs
|
||||||
{
|
{
|
||||||
if (isset($paths[0]) && !isset($paths[1]))
|
if (isset($paths[0]) && !isset($paths[1]))
|
||||||
$siRows = DB::Aowow()->selectCol('SELECT iconPath FROM dbc_spellicon WHERE iconPath NOT LIKE "glyph-rune"');
|
$siRows = DB::Aowow()->selectCol('SELECT iconPath FROM dbc_spellicon WHERE iconPath NOT LIKE "%glyph-rune%"');
|
||||||
else if (!isset($paths[0]) && isset($paths[1]))
|
else if (!isset($paths[0]) && isset($paths[1]))
|
||||||
$siRows = DB::Aowow()->selectCol('SELECT iconPath FROM dbc_spellicon WHERE iconPath LIKE "glyph-rune"');
|
$siRows = DB::Aowow()->selectCol('SELECT iconPath FROM dbc_spellicon WHERE iconPath LIKE "%glyph-rune%"');
|
||||||
else
|
else
|
||||||
$siRows = DB::Aowow()->selectCol('SELECT iconPath FROM dbc_spellicon');
|
$siRows = DB::Aowow()->selectCol('SELECT iconPath FROM dbc_spellicon');
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
{
|
{
|
||||||
if (!CLISetup::fileExists($fileName))
|
if (!CLISetup::fileExists($fileName))
|
||||||
{
|
{
|
||||||
CLISetup::log('file '.$fileName.' could not be found', MSG_LVL_ERROR);
|
CLISetup::log('file '.$fileName.' could not be found', CLISetup::LOG_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,14 +41,14 @@
|
|||||||
|
|
||||||
if (!$file)
|
if (!$file)
|
||||||
{
|
{
|
||||||
CLISetup::log('could not open file '.$fileName, MSG_LVL_ERROR);
|
CLISetup::log('could not open file '.$fileName, CLISetup::LOG_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fileSize = fileSize($fileName);
|
$fileSize = fileSize($fileName);
|
||||||
if ($fileSize < 16)
|
if ($fileSize < 16)
|
||||||
{
|
{
|
||||||
CLISetup::log('file '.$fileName.' is too small for a BLP file', MSG_LVL_ERROR);
|
CLISetup::log('file '.$fileName.' is too small for a BLP file', CLISetup::LOG_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,14 +64,14 @@
|
|||||||
$data = substr($data, 0x44);
|
$data = substr($data, 0x44);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLISetup::log('file '.$fileName.' is an incremental patch file and cannot be used by this script.', MSG_LVL_ERROR);
|
CLISetup::log('file '.$fileName.' is an incremental patch file and cannot be used by this script.', CLISetup::LOG_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (substr($data, 0, 4) != "BLP2")
|
if (substr($data, 0, 4) != "BLP2")
|
||||||
{
|
{
|
||||||
CLISetup::log('file '.$fileName.' has incorrect/unsupported magic bytes', MSG_LVL_ERROR);
|
CLISetup::log('file '.$fileName.' has incorrect/unsupported magic bytes', CLISetup::LOG_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
|
|
||||||
if ($header['format'] != 1)
|
if ($header['format'] != 1)
|
||||||
{
|
{
|
||||||
CLISetup::log('file '.$fileName.' has unsupported format'.$debugStr, MSG_LVL_ERROR);
|
CLISetup::log('file '.$fileName.' has unsupported format'.$debugStr, CLISetup::LOG_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,12 +99,12 @@
|
|||||||
|
|
||||||
if ($size == 0)
|
if ($size == 0)
|
||||||
{
|
{
|
||||||
CLISetup::log('file '.$fileName.' contains zeroes in a mips table'.$debugStr, MSG_LVL_ERROR);
|
CLISetup::log('file '.$fileName.' contains zeroes in a mips table'.$debugStr, CLISetup::LOG_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($offs + $size > $fileSize)
|
if ($offs + $size > $fileSize)
|
||||||
{
|
{
|
||||||
CLISetup::log('file '.$fileName.' is corrupted/incomplete'.$debugStr, MSG_LVL_ERROR);
|
CLISetup::log('file '.$fileName.' is corrupted/incomplete'.$debugStr, CLISetup::LOG_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
$img = icfb3($header['width'], $header['height'], substr($data, $offs, $size));
|
$img = icfb3($header['width'], $header['height'], substr($data, $offs, $size));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLISetup::log('file '.$fileName.' has unsupported type'.$debugStr, MSG_LVL_ERROR);
|
CLISetup::log('file '.$fileName.' has unsupported type'.$debugStr, CLISetup::LOG_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
{
|
{
|
||||||
if (!in_array($alphaBits * 10 + $alphaType, [0, 10, 41, 81, 87, 88]))
|
if (!in_array($alphaBits * 10 + $alphaType, [0, 10, 41, 81, 87, 88]))
|
||||||
{
|
{
|
||||||
CLISetup::log('unsupported compression type', MSG_LVL_ERROR);
|
CLISetup::log('unsupported compression type', CLISetup::LOG_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user