Skip to content

Commit 03b90c4

Browse files
committed
some minor error suppresants
1 parent ebc7a9b commit 03b90c4

File tree

9 files changed

+37
-31
lines changed

9 files changed

+37
-31
lines changed

cache/template/index.html

100644100755
File mode changed.

includes/kernel.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,12 @@
159159

160160
define('HOST_URL', ($secure ? 'https://' : 'http://').$host);
161161
define('STATIC_URL', ($secure ? 'https://' : 'http://').$host.'/static');
162-
if (User::isInGroup(U_GROUP_ADMIN) && !empty($AoWoWconf['aowow'])) // initial set
162+
163+
if (User::isInGroup(U_GROUP_ADMIN)) // initial set
163164
{
164-
DB::Aowow()->query('INSERT IGNORE INTO ?_config VALUES (?, ?, ?d, ?), (?, ?, ?d, ?)',
165-
'site_host', $host, CON_FLAG_TYPE_STRING | CON_FLAG_PERSISTENT, 'default: '.$host.' - points js to executable files (automaticly set on first run)',
166-
'static_host', $host.'/static', CON_FLAG_TYPE_STRING | CON_FLAG_PERSISTENT, 'default: '.$host.'/static - points js to images & scripts (automaticly set on first run)'
165+
DB::Aowow()->query('REPLACE INTO ?_config VALUES (?a)',
166+
[['site_host', $host, CON_FLAG_TYPE_STRING | CON_FLAG_PERSISTENT, 'default: '.$host.' - points js to executable files (automaticly set on first run)'],
167+
['static_host', $host.'/static', CON_FLAG_TYPE_STRING | CON_FLAG_PERSISTENT, 'default: '.$host.'/static - points js to images & scripts (automaticly set on first run)']]
167168
);
168169
}
169170
}

pages/account.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class AccountPage extends GenericPage
3131
'username' => [FILTER_SANITIZE_SPECIAL_CHARS, 0xC], // FILTER_FLAG_STRIP_LOW | *_HIGH
3232
'password' => [FILTER_UNSAFE_RAW, null],
3333
'c_password' => [FILTER_UNSAFE_RAW, null],
34+
'token' => [FILTER_UNSAFE_RAW, null],
3435
'remember_me' => [FILTER_CALLBACK, ['options' => 'AccountPage::rememberCallback']],
3536
'email' => [FILTER_SANITIZE_EMAIL, null]
3637
);

pages/npc.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -923,9 +923,9 @@ private function getOnKillRep($dummyIds, $mapType)
923923

924924
private function getQuotes()
925925
{
926-
$nQuotes = 0;
927-
$quotes = [];
928-
$quoteQuery = '
926+
$nQuotes = 0;
927+
$quotes = [];
928+
$quoteSrc = DB::World()->select('
929929
SELECT
930930
ct.groupid AS ARRAY_KEY, ct.id as ARRAY_KEY2, ct.`type`,
931931
ct.TextRange AS `range`,
@@ -944,9 +944,11 @@ private function getQuotes()
944944
LEFT JOIN
945945
locales_broadcast_text lbct ON ct.BroadcastTextId = lbct.ID
946946
WHERE
947-
ct.entry = ?d';
947+
ct.entry = ?d',
948+
$this->typeId
949+
);
948950

949-
foreach (DB::World()->select($quoteQuery, $this->typeId) as $text)
951+
foreach ($quoteSrc as $text)
950952
{
951953
$group = [];
952954
foreach ($text as $t)

pages/profiles.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ protected function generateContent()
110110

111111

112112

113-
$this->filter = ['query' => 1];
113+
$this->filter = ['query' => 1, 'fi' => []];
114114

115115

116116
Lang::sort('game', 'cl');
@@ -121,12 +121,12 @@ private function getTalentDistribution($tString)
121121
{
122122
$classMask = 1 << ($this->character['classs'] - 1);
123123
$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);
124-
$result = [];
124+
$result = [0, 0, 0];
125125

126126
$start = 0;
127-
foreach ($distrib as $len)
127+
foreach ($distrib as $idx => $len)
128128
{
129-
$result[] = array_sum(str_split(substr($tString, $start, $len)));
129+
$result[$idx] = array_sum(str_split(substr($tString, $start, $len)));
130130
$start += $len;
131131
}
132132

pages/user.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
die('illegal access');
55

66

7-
// exclude & weightscales are handled as Ajax
87
class UserPage extends GenericPage
98
{
109
protected $tpl = 'user';
@@ -28,10 +27,13 @@ public function __construct($pageCall, $pageParam)
2827
$this->notFound(sprintf(Lang::user('notFound'), $pageParam));
2928
}
3029
else if (User::$id)
30+
{
3131
header('Location: ?user='.User::$displayName, true, 302);
32+
die();
33+
}
3234
else
3335
$this->forwardToSignIn('user');
34-
}
36+
}
3537

3638
protected function generateContent()
3739
{

setup/tools/filegen/simpleImg.func.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function simpleImg()
2121
{
2222
$result = null;
2323

24-
if (in_array(substr($path, -4, 4), ['.png', '.blp']))
24+
if (in_array(substr($path, -4, 4), ['.png', '.blp', '.BLP', '.PNG']))
2525
$path = substr($path, 0, strlen($path) - 4);
2626

2727
$file = $path.'.png';
@@ -44,11 +44,11 @@ function simpleImg()
4444
if (isset(FileGen::$cliOpts['help']))
4545
{
4646
echo "\n";
47-
echo "available Options for subScript 'simpleImg':\n";
47+
echo "available options for subScript 'simpleImg':\n";
4848
echo " --icons (generates square icons that are used for basicly everything)\n";
4949
echo " --glyphs (decorative tidbit displayed on Infobox for Glyph Spells)\n";
5050
echo " --pagetexts (imagery contained in PageTexts on readable GameObjects or Items)\n";
51-
echo " --loadingscreens (loadingscreens (not used, skipped by default))\n";
51+
echo " --loadingscreens (loading screens (not used, skipped by default))\n";
5252

5353
return true;
5454
}
@@ -269,9 +269,9 @@ function simpleImg()
269269
if (isset($paths[0]) || isset($paths[1])) // generates icons or glyphs
270270
{
271271
if (isset($paths[0]) && !isset($paths[1]))
272-
$siRows = DB::Aowow()->selectCol('SELECT iconPath FROM dbc_spellicon WHERE iconPath NOT LIKE "glyph-rune"');
272+
$siRows = DB::Aowow()->selectCol('SELECT iconPath FROM dbc_spellicon WHERE iconPath NOT LIKE "%glyph-rune%"');
273273
else if (!isset($paths[0]) && isset($paths[1]))
274-
$siRows = DB::Aowow()->selectCol('SELECT iconPath FROM dbc_spellicon WHERE iconPath LIKE "glyph-rune"');
274+
$siRows = DB::Aowow()->selectCol('SELECT iconPath FROM dbc_spellicon WHERE iconPath LIKE "%glyph-rune%"');
275275
else
276276
$siRows = DB::Aowow()->selectCol('SELECT iconPath FROM dbc_spellicon');
277277

setup/tools/imagecreatefromblp.func.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ function imagecreatefromblp($fileName, $imgId = 0)
3333
{
3434
if (!CLISetup::fileExists($fileName))
3535
{
36-
CLISetup::log('file '.$fileName.' could not be found', MSG_LVL_ERROR);
36+
CLISetup::log('file '.$fileName.' could not be found', CLISetup::LOG_ERROR);
3737
return;
3838
}
3939

4040
$file = fopen($fileName, 'rb');
4141

4242
if (!$file)
4343
{
44-
CLISetup::log('could not open file '.$fileName, MSG_LVL_ERROR);
44+
CLISetup::log('could not open file '.$fileName, CLISetup::LOG_ERROR);
4545
return;
4646
}
4747

4848
$fileSize = fileSize($fileName);
4949
if ($fileSize < 16)
5050
{
51-
CLISetup::log('file '.$fileName.' is too small for a BLP file', MSG_LVL_ERROR);
51+
CLISetup::log('file '.$fileName.' is too small for a BLP file', CLISetup::LOG_ERROR);
5252
return;
5353
}
5454

@@ -64,14 +64,14 @@ function imagecreatefromblp($fileName, $imgId = 0)
6464
$data = substr($data, 0x44);
6565
else
6666
{
67-
CLISetup::log('file '.$fileName.' is an incremental patch file and cannot be used by this script.', MSG_LVL_ERROR);
67+
CLISetup::log('file '.$fileName.' is an incremental patch file and cannot be used by this script.', CLISetup::LOG_ERROR);
6868
return;
6969
}
7070
}
7171

7272
if (substr($data, 0, 4) != "BLP2")
7373
{
74-
CLISetup::log('file '.$fileName.' has incorrect/unsupported magic bytes', MSG_LVL_ERROR);
74+
CLISetup::log('file '.$fileName.' has incorrect/unsupported magic bytes', CLISetup::LOG_ERROR);
7575
return;
7676
}
7777

@@ -83,7 +83,7 @@ function imagecreatefromblp($fileName, $imgId = 0)
8383

8484
if ($header['format'] != 1)
8585
{
86-
CLISetup::log('file '.$fileName.' has unsupported format'.$debugStr, MSG_LVL_ERROR);
86+
CLISetup::log('file '.$fileName.' has unsupported format'.$debugStr, CLISetup::LOG_ERROR);
8787
return;
8888
}
8989

@@ -99,12 +99,12 @@ function imagecreatefromblp($fileName, $imgId = 0)
9999

100100
if ($size == 0)
101101
{
102-
CLISetup::log('file '.$fileName.' contains zeroes in a mips table'.$debugStr, MSG_LVL_ERROR);
102+
CLISetup::log('file '.$fileName.' contains zeroes in a mips table'.$debugStr, CLISetup::LOG_ERROR);
103103
return;
104104
}
105105
if ($offs + $size > $fileSize)
106106
{
107-
CLISetup::log('file '.$fileName.' is corrupted/incomplete'.$debugStr, MSG_LVL_ERROR);
107+
CLISetup::log('file '.$fileName.' is corrupted/incomplete'.$debugStr, CLISetup::LOG_ERROR);
108108
return;
109109
}
110110

@@ -116,7 +116,7 @@ function imagecreatefromblp($fileName, $imgId = 0)
116116
$img = icfb3($header['width'], $header['height'], substr($data, $offs, $size));
117117
else
118118
{
119-
CLISetup::log('file '.$fileName.' has unsupported type'.$debugStr, MSG_LVL_ERROR);
119+
CLISetup::log('file '.$fileName.' has unsupported type'.$debugStr, CLISetup::LOG_ERROR);
120120
return;
121121
}
122122

@@ -152,7 +152,7 @@ function icfb2($width, $height, $data, $alphaBits, $alphaType)
152152
{
153153
if (!in_array($alphaBits * 10 + $alphaType, [0, 10, 41, 81, 87, 88]))
154154
{
155-
CLISetup::log('unsupported compression type', MSG_LVL_ERROR);
155+
CLISetup::log('unsupported compression type', CLISetup::LOG_ERROR);
156156
return;
157157
}
158158

static/js/user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,4 +596,4 @@ Listview.extraCols.signature = {
596596
$WH.ae(a, $WH.ce('img', { src: '?signature=generate&id=' + sig.id + '.png', height: 60, width: 468 }));
597597
$WH.ae(td, a);
598598
}
599-
};
599+
};

0 commit comments

Comments
 (0)