PHP/Compat

* fixed misc issues Intellisense was nice enough to highlight.
 * mostly deprecated usage of uninitialized parameters
 * class GenericPage still needs a long, hard look and a refactor
This commit is contained in:
Sarjuuk
2024-03-11 19:40:30 +01:00
parent 3e6e43fd68
commit ec1a2afc5f
75 changed files with 387 additions and 223 deletions

View File

@@ -64,7 +64,7 @@ class AjaxAccount extends AjaxHandler
foreach ($ids as $typeId)
DB::Aowow()->query('INSERT INTO ?_account_excludes (`userId`, `type`, `typeId`, `mode`) VALUES (?a) ON DUPLICATE KEY UPDATE mode = (mode ^ 0x3)', array(
User::$id, $type, $typeId, in_array($includes, $typeId) ? 2 : 1
User::$id, $type, $typeId, in_array($typeId, $includes) ? 2 : 1
));
return;

View File

@@ -411,7 +411,8 @@ class AjaxComment extends AjaxHandler
return;
}
Util::createReport(1, 19, $this->_post['id'][0], '[General Reply Report]');
$report = new Report(Report::MODE_COMMENT, Report::CO_INAPPROPRIATE, $this->_post['id'][0]);
$report->create('Report Reply Button Click');
}
protected function handleReplyUpvote() : void

View File

@@ -29,7 +29,7 @@ class AjaxGotocomment extends AjaxHandler
if ($_ = DB::Aowow()->selectRow('SELECT IFNULL(c2.id, c1.id) AS id, IFNULL(c2.type, c1.type) AS type, IFNULL(c2.typeId, c1.typeId) AS typeId FROM ?_comments c1 LEFT JOIN ?_comments c2 ON c1.replyTo = c2.id WHERE c1.id = ?d', $this->_get['id']))
return '?'.Type::getFileString(intVal($_['type'])).'='.$_['typeId'].'#comments:id='.$_['id'].($_['id'] != $this->_get['id'] ? ':reply='.$this->_get['id'] : null);
else
trigger_error('AjaxGotocomment::handleGoToComment - could not find comment #'.$this->get['id'], E_USER_ERROR);
trigger_error('AjaxGotocomment::handleGoToComment - could not find comment #'.$this->_get['id'], E_USER_ERROR);
return '.';
}

View File

@@ -19,6 +19,7 @@ abstract class BaseType
private $itrStack = [];
public static $dataTable = '';
public static $contribute = CONTRIBUTE_ANY;
/*
@@ -925,6 +926,8 @@ abstract class Filter
*/
protected $genericFilter = [];
protected $enums = []; // criteriumID => [validOptionList]
/*
fieldId => [checkType, checkValue[, fieldIsArray]]
*/

View File

@@ -352,6 +352,11 @@ define('SIDE_ALLIANCE', 1);
define('SIDE_HORDE', 2);
define('SIDE_BOTH', 3);
// Expansion
define('EXP_CLASSIC', 0);
define('EXP_BC', 1);
define('EXP_WOTLK', 2);
// ClassMask
define('CLASS_WARRIOR', 0x001);
define('CLASS_PALADIN', 0x002);

View File

@@ -93,6 +93,8 @@ require_once __DIR__ . '/CacherImpl.php';
*/
abstract class DbSimple_Database extends DbSimple_LastError
{
private $attributes;
/**
* Public methods.
*/

View File

@@ -26,6 +26,8 @@ class DbSimple_Mysqli extends DbSimple_Database
{
var $link;
private $_lastQuery;
/**
* constructor(string $dsn)
* Connect to MySQL server.

View File

@@ -15,6 +15,8 @@ class SmartAI
private $srcType = 0;
private $entry = 0;
private $rowKey = '';
private $miscData = [];
private $quotes = [];
private $summons = null;

View File

@@ -122,6 +122,7 @@ class RemoteArenaTeamList extends ArenaTeamList
);
private $members = [];
private $rankOrder = [];
public function __construct($conditions = [], $miscData = null)
{

View File

@@ -22,6 +22,9 @@ class ItemList extends BaseType
private $vendors = [];
private $jsGlobals = []; // getExtendedCost creates some and has no access to template
private $enhanceR = [];
private $relEnchant = [];
protected $queryBase = 'SELECT i.*, i.block AS tplBlock, i.armor AS tplArmor, i.dmgMin1 AS tplDmgMin1, i.dmgMax1 AS tplDmgMax1, i.id AS ARRAY_KEY, i.id AS id FROM ?_items i';
protected $queryOpts = array( // 3 => Type::ITEM
'i' => [['is', 'src', 'ic'], 'o' => 'i.quality DESC, i.itemLevel DESC'],

View File

@@ -509,6 +509,8 @@ class RemoteProfileList extends ProfileList
'at' => [['atm'], 'j' => 'arena_team at ON atm.arenaTeamId = at.arenaTeamId', 's' => ', at.name AS arenateam, IF(at.captainGuid = c.guid, 1, 0) AS captain']
);
private $rnItr = []; // rename iterator [name => nCharsWithThisName]
public function __construct($conditions = [], $miscData = null)
{
// select DB by realm

View File

@@ -1033,7 +1033,7 @@ abstract class Util
return $success;
}
public static function createHash($length = 40) // just some random numbers for unsafe identifictaion purpose
public static function createHash($length = 40) // just some random numbers for unsafe identification purpose
{
static $seed = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$hash = '';
@@ -2010,21 +2010,21 @@ class Report
{
if ($mode < 0 || $reason <= 0 || !$subject)
{
trigger_error('AjaxContactus::handleContactUs - malformed contact request received', E_USER_ERROR);
trigger_error('Report - malformed contact request received', E_USER_ERROR);
$this->errorCode = self::ERR_MISCELLANEOUS;
return;
}
if (!isset($this->context[$mode][$reason]))
{
trigger_error('AjaxContactus::handleContactUs - report has invalid context (mode:'.$mode.' / reason:'.$reason.')', E_USER_ERROR);
trigger_error('Report - report has invalid context (mode:'.$mode.' / reason:'.$reason.')', E_USER_ERROR);
$this->errorCode = self::ERR_MISCELLANEOUS;
return;
}
if (!User::$id && !User::$ip)
{
trigger_error('AjaxContactus::handleContactUs - could not determine IP for anonymous user', E_USER_ERROR);
trigger_error('Report - could not determine IP for anonymous user', E_USER_ERROR);
$this->errorCode = self::ERR_MISCELLANEOUS;
return;
}