Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[474] Use correct argument for sprintf function in Characters::HasTal…

…ent(). Event check in character-feed-data.php
  • Loading branch information...
commit ddeb98d0cc43a65c0939ea99407a05cfb437a032 1 parent ddfd673
@Shadez authored
View
5 character-feed-data.php
@@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release 4.50
- * @revision 456
+ * @revision 474
* @copyright (c) 2009-2011 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -77,6 +77,9 @@
}
if(isset($character_feed) && is_array($character_feed) && $isCharacter) {
foreach($character_feed as $feed_item) {
+ if(!is_array($feed_item) || !isset($feed_item['event'])) {
+ continue;
+ }
$xml->XMLWriter()->startElement('event');
foreach($feed_item['event'] as $f_header_key => $f_header_value) {
$xml->XMLWriter()->startAttribute($f_header_key);
View
22 includes/classes/class.characters.php
@@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release 4.50
- * @revision 470
+ * @revision 474
* @copyright (c) 2009-2011 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -1503,6 +1503,22 @@ public function GetCharacterReputation() {
return $factionReputation;
}
+ private function GetFactionCategories($faction) {
+ $path = array();
+ $in_process = true;
+ $id = $faction;
+ while($in_process) {
+ $id = Armory::$aDB->selectCell("SELECT `category` FROM `ARMORYDBPREFIX_faction` WHERE `id` = %d", $id);
+ if($id > 0) {
+ $path[] = $id;
+ }
+ else {
+ $in_process = false;
+ }
+ }
+ return $path;
+ }
+
/**
* Returns value of $fieldNum field. Requires $this->guid or int $guid as second parameter!
* @category Characters class
@@ -3050,11 +3066,11 @@ public function HasTalent($talent_id, $active_spec = true, $rank = -1) {
}
$sql_data = array(
'activeSpec' => array(
- sprintf('SELECT `spell` FROM `character_talent` WHERE `spell` IN (%s) AND `guid`=%%d AND `spec`=%%d', array($talent_spells['Rank_1'], $talent_spells['Rank_2'], $talent_spells['Rank_3'], $talent_spells['Rank_4'], $talent_spells['Rank_5'])),
+ sprintf('SELECT `spell` FROM `character_talent` WHERE `spell` IN (%s) AND `guid`=%%d AND `spec`=%%d', $talent_spells['Rank_1'] . ', ' . $talent_spells['Rank_2'] . ', ' . $talent_spells['Rank_3'] . ', ' . $talent_spells['Rank_4'] . ', ' . $talent_spells['Rank_5']),
sprintf('SELECT 1 FROM `character_talent` WHERE `spell`=%d AND `guid`=%%d AND `spec`=%%d'. $talent_spells['Rank_' . $rank + 1])
),
'spec' => array(
- sprintf('SELECT `spell` FROM `character_talent` WHERE `spell` IN (%s) AND `guid`=%%d', array($talent_spells['Rank_1'], $talent_spells['Rank_2'], $talent_spells['Rank_3'], $talent_spells['Rank_4'], $talent_spells['Rank_5'])),
+ sprintf('SELECT `spell` FROM `character_talent` WHERE `spell` IN (%s) AND `guid`=%%d', $talent_spells['Rank_1'] . ', ' . $talent_spells['Rank_2'] . ', ' . $talent_spells['Rank_3'] . ', ' . $talent_spells['Rank_4'] . ', ' . $talent_spells['Rank_5']),
sprintf('SELECT 1 FROM `character_talent` WHERE `spell`=%d AND `guid`=%%d', $talent_spells['Rank_' . $rank + 1])
)
);
View
2  includes/revision_nr.php
@@ -1,5 +1,5 @@
<?php
-define('ARMORY_REVISION', 473);
+define('ARMORY_REVISION', 474);
define('DB_VERSION', 'armory_r471');
define('CONFIG_VERSION', '2001201101');
?>
Please sign in to comment.
Something went wrong with that request. Please try again.