mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Core/Compat
* create namespace Aowow to avoid naming conflicts * inclues/libs/ is outside of the Aowow namespace
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -44,10 +46,10 @@ class AccountPage extends GenericPage
|
||||
|
||||
protected $_post = array(
|
||||
'username' => ['filter' => FILTER_SANITIZE_SPECIAL_CHARS, 'flags' => FILTER_FLAG_STRIP_AOWOW],
|
||||
'password' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkTextLine'],
|
||||
'c_password' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkTextLine'],
|
||||
'password' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkTextLine'],
|
||||
'c_password' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkTextLine'],
|
||||
'token' => ['filter' => FILTER_SANITIZE_SPECIAL_CHARS, 'flags' => FILTER_FLAG_STRIP_AOWOW],
|
||||
'remember_me' => ['filter' => FILTER_CALLBACK, 'options' => 'AccountPage::rememberCallback'],
|
||||
'remember_me' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\AccountPage::rememberCallback'],
|
||||
'email' => ['filter' => FILTER_SANITIZE_EMAIL]
|
||||
);
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -38,7 +40,7 @@ class AchievementPage extends GenericPage
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Locale::tryFromDomain']];
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\Locale::tryFromDomain']];
|
||||
|
||||
private $powerTpl = '$WowheadPower.registerAchievement(%d, %d, %s);';
|
||||
|
||||
@@ -548,7 +550,7 @@ class AchievementPage extends GenericPage
|
||||
|
||||
protected function generateTooltip()
|
||||
{
|
||||
$power = new StdClass();
|
||||
$power = new \StdClass();
|
||||
if (!$this->subject->error)
|
||||
{
|
||||
$power->{'name_'.Lang::getLocale()->json()} = $this->subject->getField('name', true);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -22,8 +24,8 @@ class AdminPage extends GenericPage
|
||||
|
||||
protected $_get = array(
|
||||
'all' => ['filter' => FILTER_UNSAFE_RAW],
|
||||
'type' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkInt'],
|
||||
'typeid' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkInt'],
|
||||
'type' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkInt'],
|
||||
'typeid' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkInt'],
|
||||
'user' => ['filter' => FILTER_CALLBACK, 'options' => 'urldecode']
|
||||
);
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -23,8 +25,8 @@ class ComparePage extends GenericPage
|
||||
protected $summary = [];
|
||||
protected $cmpItems = [];
|
||||
|
||||
protected $_get = ['compare' => ['filter' => FILTER_CALLBACK, 'options' => 'ComparePage::checkCompareString']];
|
||||
protected $_cookie = ['compare_groups' => ['filter' => FILTER_CALLBACK, 'options' => 'ComparePage::checkCompareString']];
|
||||
protected $_get = ['compare' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\ComparePage::checkCompareString']];
|
||||
protected $_cookie = ['compare_groups' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\ComparePage::checkCompareString']];
|
||||
|
||||
private $compareString = '';
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -17,7 +19,7 @@ class CurrencyPage extends GenericPage
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Locale::tryFromDomain']];
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\Locale::tryFromDomain']];
|
||||
|
||||
private $powerTpl = '$WowheadPower.registerCurrency(%d, %d, %s);';
|
||||
|
||||
@@ -228,7 +230,7 @@ class CurrencyPage extends GenericPage
|
||||
|
||||
protected function generateTooltip()
|
||||
{
|
||||
$power = new StdClass();
|
||||
$power = new \StdClass();
|
||||
if (!$this->subject->error)
|
||||
{
|
||||
$power->{'name_'.Lang::getLocale()->json()} = $this->subject->getField('name', true);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -19,7 +21,7 @@ class EventPage extends GenericPage
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Locale::tryFromDomain']];
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\Locale::tryFromDomain']];
|
||||
|
||||
private $powerTpl = '$WowheadPower.registerHoliday(%d, %d, %s);';
|
||||
private $hId = 0;
|
||||
@@ -280,7 +282,7 @@ class EventPage extends GenericPage
|
||||
|
||||
protected function generateTooltip() : string
|
||||
{
|
||||
$power = new StdClass();
|
||||
$power = new \StdClass();
|
||||
if (!$this->subject->error)
|
||||
{
|
||||
$power->{'name_'.Lang::getLocale()->json()} = $this->subject->getField('name', true);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -922,8 +924,10 @@ class GenericPage
|
||||
}
|
||||
|
||||
// load brick with more text then vars
|
||||
protected function localizedBrick(string $file, Locale $loc = Locale::EN) : void
|
||||
protected function localizedBrick(string $file, ?Locale $loc = null) : void
|
||||
{
|
||||
$loc ??= Lang::getLocale();
|
||||
|
||||
if (!$this->isSaneInclude('template/localized/', $file.'_'.$loc->value))
|
||||
{
|
||||
if ($loc == Locale::EN || !$this->isSaneInclude('template/localized/', $file.'_'.Locale::EN->value))
|
||||
@@ -1039,12 +1043,12 @@ class GenericPage
|
||||
{
|
||||
try
|
||||
{
|
||||
$rp = new ReflectionProperty($this, $key);
|
||||
$rp = new \ReflectionProperty($this, $key);
|
||||
if ($rp && ($rp->isPublic() || $rp->isProtected()))
|
||||
if (!in_array($key, $noCache))
|
||||
$cache[$key] = $val;
|
||||
}
|
||||
catch (ReflectionException $e) { } // shut up!
|
||||
catch (\ReflectionException $e) { } // shut up!
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1175,11 +1179,11 @@ class GenericPage
|
||||
return false;
|
||||
}
|
||||
|
||||
private function memcached() : Memcached
|
||||
private function memcached() : \Memcached
|
||||
{
|
||||
if (!$this->memcached && (Cfg::get('CACHE_MODE') & CACHE_MODE_MEMCACHED))
|
||||
{
|
||||
$this->memcached = new Memcached();
|
||||
$this->memcached = new \Memcached();
|
||||
$this->memcached->addServer('localhost', 11211);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -38,22 +40,22 @@ class GuidePage extends GenericPage
|
||||
private /* bool */ $save = false;
|
||||
|
||||
protected /* array */ $_get = array(
|
||||
'id' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkInt'],
|
||||
'rev' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkInt']
|
||||
'id' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkInt'],
|
||||
'rev' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkInt']
|
||||
);
|
||||
|
||||
protected /* array */ $_post = array(
|
||||
'save' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkEmptySet'],
|
||||
'submit' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkEmptySet'],
|
||||
'title' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkTextLine'],
|
||||
'name' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkTextLine'],
|
||||
'description' => ['filter' => FILTER_CALLBACK, 'options' => 'GuidePage::checkDescription'],
|
||||
'changelog' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkTextBlob'],
|
||||
'body' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkTextBlob'],
|
||||
'locale' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkInt'],
|
||||
'category' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkInt'],
|
||||
'specId' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkInt'],
|
||||
'classId' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkInt']
|
||||
'save' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkEmptySet'],
|
||||
'submit' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkEmptySet'],
|
||||
'title' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkTextLine'],
|
||||
'name' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkTextLine'],
|
||||
'description' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GuidePage::checkDescription'],
|
||||
'changelog' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkTextBlob'],
|
||||
'body' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkTextBlob'],
|
||||
'locale' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkInt'],
|
||||
'category' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkInt'],
|
||||
'specId' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkInt'],
|
||||
'classId' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkInt']
|
||||
);
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
@@ -500,7 +502,7 @@ class GuidePage extends GenericPage
|
||||
|
||||
protected function generateTooltip()
|
||||
{
|
||||
$power = new StdClass();
|
||||
$power = new \StdClass();
|
||||
if (!$this->subject->error)
|
||||
{
|
||||
$power->{'name_'.Lang::getLocale()->json()} = strip_tags($this->name);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -29,11 +31,11 @@ class ItemPage extends genericPage
|
||||
);
|
||||
|
||||
protected $_get = array(
|
||||
'domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Locale::tryFromDomain'],
|
||||
'rand' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkInt'],
|
||||
'ench' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkInt'],
|
||||
'gems' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkIntArray'],
|
||||
'sock' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkEmptySet']
|
||||
'domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\Locale::tryFromDomain'],
|
||||
'rand' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkInt'],
|
||||
'ench' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkInt'],
|
||||
'gems' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkIntArray'],
|
||||
'sock' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkEmptySet']
|
||||
);
|
||||
|
||||
private $powerTpl = '$WowheadPower.registerItem(%s, %d, %s);';
|
||||
@@ -1030,7 +1032,7 @@ class ItemPage extends genericPage
|
||||
|
||||
protected function generateTooltip()
|
||||
{
|
||||
$power = new StdClass();
|
||||
$power = new \StdClass();
|
||||
if (!$this->subject->error)
|
||||
{
|
||||
$power->{'name_'.Lang::getLocale()->json()} = Lang::unescapeUISequences($this->subject->getField('name', true, false, $this->enhancedTT), Lang::FMT_RAW);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -25,7 +27,7 @@ class ItemsetPage extends GenericPage
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $scripts = [[SC_JS_FILE, 'js/swfobject.js'], [SC_JS_FILE, 'js/Summary.js']];
|
||||
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Locale::tryFromDomain']];
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\Locale::tryFromDomain']];
|
||||
|
||||
private $powerTpl = '$WowheadPower.registerItemSet(%d, %d, %s);';
|
||||
|
||||
@@ -241,7 +243,7 @@ class ItemsetPage extends GenericPage
|
||||
|
||||
protected function generateTooltip()
|
||||
{
|
||||
$power = new StdClass();
|
||||
$power = new \StdClass();
|
||||
if (!$this->subject->error)
|
||||
{
|
||||
$power->{'name_'.Lang::getLocale()->json()} = $this->subject->getField('name', true);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -24,7 +26,7 @@ class NpcPage extends GenericPage
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $scripts = [[SC_JS_FILE, 'js/swfobject.js'], [SC_CSS_FILE, 'css/Profiler.css']];
|
||||
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Locale::tryFromDomain']];
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\Locale::tryFromDomain']];
|
||||
|
||||
private $soundIds = [];
|
||||
private $powerTpl = '$WowheadPower.registerNpc(%d, %d, %s);';
|
||||
@@ -899,7 +901,7 @@ class NpcPage extends GenericPage
|
||||
|
||||
protected function generateTooltip()
|
||||
{
|
||||
$power = new StdClass();
|
||||
$power = new \StdClass();
|
||||
if (!$this->subject->error)
|
||||
{
|
||||
$power->{'name_'.Lang::getLocale()->json()} = $this->subject->getField('name', true);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -21,7 +23,7 @@ class ObjectPage extends GenericPage
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $scripts = [[SC_JS_FILE, 'js/swfobject.js']];
|
||||
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Locale::tryFromDomain']];
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\Locale::tryFromDomain']];
|
||||
|
||||
private $powerTpl = '$WowheadPower.registerObject(%d, %d, %s);';
|
||||
|
||||
@@ -485,7 +487,7 @@ class ObjectPage extends GenericPage
|
||||
|
||||
protected function generateTooltip()
|
||||
{
|
||||
$power = new StdClass();
|
||||
$power = new \StdClass();
|
||||
if (!$this->subject->error)
|
||||
{
|
||||
$power->{'name_'.Lang::getLocale()->json()} = Lang::unescapeUISequences($this->subject->getField('name', true), Lang::FMT_RAW);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -30,8 +32,8 @@ class ProfilePage extends GenericPage
|
||||
);
|
||||
|
||||
protected $_get = array(
|
||||
'domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Locale::tryFromDomain'],
|
||||
'new' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkEmptySet']
|
||||
'domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\Locale::tryFromDomain'],
|
||||
'new' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkEmptySet']
|
||||
);
|
||||
|
||||
private $isCustom = false;
|
||||
@@ -189,7 +191,7 @@ class ProfilePage extends GenericPage
|
||||
if (!$this->isCustom)
|
||||
$id = "'".$this->profile[0].'.'.urlencode($this->profile[1]).'.'.urlencode($this->profile[2])."'";
|
||||
|
||||
$power = new StdClass();
|
||||
$power = new \StdClass();
|
||||
if ($this->subject && !$this->subject->error && $this->subject->isVisibleToUser())
|
||||
{
|
||||
$n = $this->subject->getField('name');
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -33,7 +35,7 @@ class QuestPage extends GenericPage
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $scripts = [[SC_JS_FILE, 'js/ShowOnMap.js'], [SC_CSS_FILE, 'css/Book.css']];
|
||||
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Locale::tryFromDomain']];
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\Locale::tryFromDomain']];
|
||||
|
||||
private $powerTpl = '$WowheadPower.registerQuest(%d, %d, %s);';
|
||||
|
||||
@@ -1042,7 +1044,7 @@ class QuestPage extends GenericPage
|
||||
|
||||
protected function generateTooltip()
|
||||
{
|
||||
$power = new StdClass();
|
||||
$power = new \StdClass();
|
||||
if (!$this->subject->error)
|
||||
{
|
||||
$power->{'name_'.Lang::getLocale()->json()} = Lang::unescapeUISequences($this->subject->getField('name', true), Lang::FMT_RAW);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -32,8 +34,8 @@ class ScreenshotPage extends GenericPage
|
||||
protected $imgHash = '';
|
||||
|
||||
protected $_post = array(
|
||||
'coords' => ['filter' => FILTER_CALLBACK, 'options' => 'ScreenshotPage::checkCoords'],
|
||||
'screenshotalt' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkTextBlob']
|
||||
'coords' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\ScreenshotPage::checkCoords'],
|
||||
'screenshotalt' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkTextBlob']
|
||||
);
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
@@ -350,7 +352,7 @@ class ScreenshotPage extends GenericPage
|
||||
}
|
||||
|
||||
// check if file is an image; allow jpeg, png
|
||||
$finfo = new finfo(FILEINFO_MIME); // fileInfo appends charset information and other nonsense
|
||||
$finfo = new \finfo(FILEINFO_MIME); // fileInfo appends charset information and other nonsense
|
||||
$mime = $finfo->file($_FILES['screenshotfile']['tmp_name']);
|
||||
if (preg_match('/^image\/(png|jpe?g)/i', $mime, $m))
|
||||
$isPNG = $m[0] == 'image/png';
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -37,12 +39,12 @@ class SearchPage extends GenericPage
|
||||
protected $invalid = [];
|
||||
|
||||
protected $_get = array(
|
||||
'wt' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkIntArray'],
|
||||
'wtv' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkIntArray'],
|
||||
'slots' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkIntArray'],
|
||||
'type' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkInt'],
|
||||
'json' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkEmptySet'],
|
||||
'opensearch' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkEmptySet']
|
||||
'wt' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkIntArray'],
|
||||
'wtv' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkIntArray'],
|
||||
'slots' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkIntArray'],
|
||||
'type' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkInt'],
|
||||
'json' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkEmptySet'],
|
||||
'opensearch' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkEmptySet']
|
||||
);
|
||||
|
||||
private $maxResults = 500;
|
||||
@@ -235,6 +237,8 @@ class SearchPage extends GenericPage
|
||||
header(MIME_TYPE_JSON);
|
||||
exit(Util::toJSON([$this->search, [], []]));
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
public function display(string $override = '') : never
|
||||
@@ -245,6 +249,8 @@ class SearchPage extends GenericPage
|
||||
$this->displayExtra([$this, 'generateOpenSearch'], MIME_TYPE_OPENSEARCH);
|
||||
else if ($this->searchMask & SEARCH_TYPE_JSON)
|
||||
$this->displayExtra([$this, 'generateJsonSearch']);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
// !note! dear reader, if you ever try to generate a string, that is to be evaled by JS, NEVER EVER terminate with a \n ..... $totalHoursWasted +=2;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -18,7 +20,7 @@ class SoundPage extends GenericPage
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
|
||||
protected $special = false;
|
||||
protected $_get = ['playlist' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkEmptySet']];
|
||||
protected $_get = ['playlist' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkEmptySet']];
|
||||
|
||||
private $cat = 0;
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -38,7 +40,7 @@ class SpellPage extends GenericPage
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $scripts = [[SC_JS_FILE, 'js/swfobject.js']];
|
||||
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Locale::tryFromDomain']];
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\Locale::tryFromDomain']];
|
||||
|
||||
private $difficulties = [];
|
||||
private $firstRank = 0;
|
||||
@@ -1279,7 +1281,7 @@ class SpellPage extends GenericPage
|
||||
|
||||
protected function generateTooltip()
|
||||
{
|
||||
$power = new StdClass();
|
||||
$power = new \StdClass();
|
||||
if (!$this->subject->error)
|
||||
{
|
||||
[$tooltip, $ttSpells] = $this->subject->renderTooltip();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -21,7 +23,7 @@ class UtilityPage extends GenericPage
|
||||
'unrated-comments', 11 => 'latest-videos', 12 => 'most-comments', 13 => 'missing-screenshots'
|
||||
);
|
||||
|
||||
protected $_get = ['rss' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkEmptySet']];
|
||||
protected $_get = ['rss' => ['filter' => FILTER_CALLBACK, 'options' => 'Aowow\GenericPage::checkEmptySet']];
|
||||
|
||||
private $page = '';
|
||||
private $rss = false;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
@@ -156,7 +158,7 @@ class ZonesPage extends GenericPage
|
||||
'parent' => 'mapper-generic'
|
||||
),
|
||||
'som' => $somData,
|
||||
'mapperData' => [$mapFile => new stdClass()]
|
||||
'mapperData' => [$mapFile => new \StdClass()]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user