* fixed some recuring errors from db-log (mostly missing checks)
This commit is contained in:
Sarjuuk
2015-08-08 00:46:31 +02:00
parent 220fb81833
commit 3c69284e15
13 changed files with 26 additions and 22 deletions

View File

@@ -121,6 +121,8 @@ class CommunityContent
case TYPE_RACE: $obj = new CharRaceList($cnd); break; case TYPE_RACE: $obj = new CharRaceList($cnd); break;
case TYPE_SKILL: $obj = new SkillList($cnd); break; case TYPE_SKILL: $obj = new SkillList($cnd); break;
case TYPE_CURRENCY: $obj = new CurrencyList($cnd); break; case TYPE_CURRENCY: $obj = new CurrencyList($cnd); break;
case TYPE_EMOTE: $obj = new EmoteList($cnd); break;
case TYPE_ENCHANTMENT: $obj = new EnchantmentList($cnd); break;
default: continue; default: continue;
} }

View File

@@ -888,7 +888,7 @@ abstract class Filter
protected function modularizeString(array $fields, $string = '') protected function modularizeString(array $fields, $string = '')
{ {
if (!$string) if (!$string && !empty($this->fiData['v']['na']))
$string = $this->fiData['v']['na']; $string = $this->fiData['v']['na'];
$qry = []; $qry = [];

View File

@@ -92,6 +92,7 @@ class GameObjectList extends BaseType
$x = '<table>'; $x = '<table>';
$x .= '<tr><td><b class="q">'.$this->getField('name', true).'</b></td></tr>'; $x .= '<tr><td><b class="q">'.$this->getField('name', true).'</b></td></tr>';
if ($this->curTpl['typeCat'])
if ($_ = Lang::gameObject('type', $this->curTpl['typeCat'])) if ($_ = Lang::gameObject('type', $this->curTpl['typeCat']))
$x .= '<tr><td>'.$_.'</td></tr>'; $x .= '<tr><td>'.$_.'</td></tr>';

View File

@@ -653,7 +653,7 @@ class ItemList extends BaseType
$x .= '<span class="q1"><a href="?enchantment='.$geId.'">'.Util::localizedString($gemEnch, 'name').'</a></span><br />'; $x .= '<span class="q1"><a href="?enchantment='.$geId.'">'.Util::localizedString($gemEnch, 'name').'</a></span><br />';
// activation conditions for meta gems // activation conditions for meta gems
if ($gemEnch['conditionId']) if (!empty($gemEnch['conditionId']))
{ {
if ($gemCnd = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantmentcondition WHERE id = ?d', $gemEnch['conditionId'])) if ($gemCnd = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantmentcondition WHERE id = ?d', $gemEnch['conditionId']))
{ {
@@ -1469,7 +1469,7 @@ class ItemList extends BaseType
for ($i = 1; $i < 6; $i++) for ($i = 1; $i < 6; $i++)
{ {
$enchId = $data['enchantId'.$i]; $enchId = $data['enchantId'.$i];
if ($enchId <= 0) if ($enchId <= 0 || empty($this->rndEnchIds[$enchId]))
continue; continue;
if ($data['allocationPct'.$i] > 0) // RandomSuffix: scaling Enchantment; enchId < 0 if ($data['allocationPct'.$i] > 0) // RandomSuffix: scaling Enchantment; enchId < 0

View File

@@ -51,7 +51,7 @@ $lang = array(
'or' => " oder ", 'or' => " oder ",
'back' => "Zurück", 'back' => "Zurück",
'reputationTip' => "Rufpunkte", 'reputationTip' => "Rufpunkte",
'byUserTimeAgo' => "Von <a href=\"".HOST_URL."/?user=%s\">%1s</a> vor %s", 'byUserTimeAgo' => 'Von <a href="'.HOST_URL.'/?user=%s">%1$s</a> vor %s',
// filter // filter
'extSearch' => "Erweiterte Suche", 'extSearch' => "Erweiterte Suche",

View File

@@ -46,7 +46,7 @@ $lang = array(
'or' => " or ", 'or' => " or ",
'back' => "Back", 'back' => "Back",
'reputationTip' => "Reputation points", 'reputationTip' => "Reputation points",
'byUserTimeAgo' => "By <a href=\"".HOST_URL."/?user=%s\">%1s</a> %s ago", 'byUserTimeAgo' => 'By <a href="'.HOST_URL.'/?user=%s">%1$s</a> %s ago',
// filter // filter
'extSearch' => "Extended search", 'extSearch' => "Extended search",

View File

@@ -51,7 +51,7 @@ $lang = array(
'or' => " o ", 'or' => " o ",
'back' => "Arrière", 'back' => "Arrière",
'reputationTip' => "Puntos de reputación", 'reputationTip' => "Puntos de reputación",
'byUserTimeAgo' => "Por <a href=\"".HOST_URL."/?user=%s\">%1s</a> hace %s", 'byUserTimeAgo' => 'Por <a href="'.HOST_URL.'/?user=%s">%1$s</a> hace %s',
// filter // filter
'extSearch' => "Extender búsqueda", 'extSearch' => "Extender búsqueda",

View File

@@ -51,7 +51,7 @@ $lang = array(
'or' => " ou ", 'or' => " ou ",
'back' => "Redro", 'back' => "Redro",
'reputationTip' => "Points de réputation", 'reputationTip' => "Points de réputation",
'byUserTimeAgo' => "Par <a href=\"".HOST_URL."/?user=%s\">%1s</a> il y a %s", 'byUserTimeAgo' => 'Par <a href="'.HOST_URL.'/?user=%s">%1$s</a> il y a %s',
// filter // filter
'extSearch' => "Recherche avancée", 'extSearch' => "Recherche avancée",

View File

@@ -51,7 +51,7 @@ $lang = array(
'or' => " или ", 'or' => " или ",
'back' => "Назад", 'back' => "Назад",
'reputationTip' => "Очки репутации", 'reputationTip' => "Очки репутации",
'byUserTimeAgo' => "От <a href=\"".HOST_URL."/?user=%s\">%1s</a> %s назад", 'byUserTimeAgo' => 'От <a href="'.HOST_URL.'/?user=%s">%1s</a> %s назад',
// filter // filter
'extSearch' => "Расширенный поиск", 'extSearch' => "Расширенный поиск",

View File

@@ -103,13 +103,13 @@ class AchievementPage extends GenericPage
if ($this->subject->getField('flags') & 0x100 && DB::isConnectable(DB_AUTH)) if ($this->subject->getField('flags') & 0x100 && DB::isConnectable(DB_AUTH))
{ {
$avlb = []; $avlb = [];
foreach (DB::Auth()->selectCol('SELECT id AS ARRAY_KEY, name FROM realmlist WHERE allowedSecurityLevel = 0 AND gamebuild = ?d', WOW_VERSION) AS $rId => $name) foreach (DB::Auth()->selectCol('SELECT id AS ARRAY_KEY, name FROM realmlist WHERE allowedSecurityLevel = 0 AND gamebuild = ?d', WOW_BUILD) AS $rId => $name)
{ {
if (!DB::isConnectable(DB_CHARACTERS . $rId)) if (!DB::isConnectable(DB_CHARACTERS . $rId))
continue; continue;
if (!DB::Characters($rId)->selectCell('SELECT 1 FROM character_achievement WHERE achievement = ?d LIMIT 1', $this->typeId)) if (!DB::Characters($rId)->selectCell('SELECT 1 FROM character_achievement WHERE achievement = ?d LIMIT 1', $this->typeId))
$avlb[] = $name; $avlb[] = Util::ucWords($name);
} }
if ($avlb) if ($avlb)

View File

@@ -74,6 +74,7 @@ class ComparePage extends GenericPage
if (empty($data[$itemId])) if (empty($data[$itemId]))
continue; continue;
if (!empty($data[$itemId]['subitems']))
foreach ($data[$itemId]['subitems'] as &$si) foreach ($data[$itemId]['subitems'] as &$si)
$si['enchantment'] = implode(', ', $si['enchantment']); $si['enchantment'] = implode(', ', $si['enchantment']);

View File

@@ -100,6 +100,8 @@ class SearchPage extends GenericPage
if (CFG_MAINTENANCE && !User::isInGroup(U_GROUP_EMPLOYEE) && !($this->searchMask & SEARCH_TYPE_REGULAR)) if (CFG_MAINTENANCE && !User::isInGroup(U_GROUP_EMPLOYEE) && !($this->searchMask & SEARCH_TYPE_REGULAR))
$this->notFound(); $this->notFound();
parent::__construct($pageCall, $pageParam); // just to set g_user and g_locale
// fill include, exclude and ignore // fill include, exclude and ignore
$this->tokenizeQuery(); $this->tokenizeQuery();
@@ -109,8 +111,6 @@ class SearchPage extends GenericPage
$this->mode = CACHE_TYPE_NONE; $this->mode = CACHE_TYPE_NONE;
$this->notFound(); $this->notFound();
} }
parent::__construct($pageCall, $pageParam); // just to set g_user and g_locale
} }
private function tokenizeQuery() private function tokenizeQuery()

View File

@@ -1022,7 +1022,7 @@ class SpellPage extends GenericPage
SELECT IF(t1.ID > 200000, t2.ID, t1.ID) SELECT IF(t1.ID > 200000, t2.ID, t1.ID)
FROM npc_trainer t1 FROM npc_trainer t1
LEFT JOIN npc_trainer t2 ON t2.SpellID = -t1.ID LEFT JOIN npc_trainer t2 ON t2.SpellID = -t1.ID
WHERE t1.SpellID IN (?a)', WHERE t1.SpellID = ?d',
$this->typeId $this->typeId
); );
} }
@@ -1667,7 +1667,7 @@ class SpellPage extends GenericPage
$foo['name'] .= $_; $foo['name'] .= $_;
break; break;
case 33: // Open Lock case 33: // Open Lock
$_ = Lang::spell('lockType', $effMV); $_ = $effMV ? Lang::spell('lockType', $effMV) : $effMV;
if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) if ($_ && User::isInGroup(U_GROUP_EMPLOYEE))
$_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_);
else if (!$_) else if (!$_)