修正插件中部分语法兼容性错误

This commit is contained in:
ffcz 2017-01-19 23:48:48 +08:00
parent 3aa4823179
commit a920140963
7 changed files with 15 additions and 14 deletions

View File

@ -13,7 +13,7 @@ if(!defined('IN_MOBILE_API')) {
class mobile_api_sub {
function getvariable() {
public static function getvariable() {
global $_G;
if(empty($_G['forum'])) {
$allowpost = 0;

View File

@ -13,7 +13,7 @@ if(!defined('IN_MOBILE_API')) {
class mobile_api_sub {
function getvariable() {
public static function getvariable() {
global $_G;
if(empty($_G['forum'])) {
$allowpost = 0;

View File

@ -134,7 +134,7 @@ class mobile_api {
return uc_fopen2(UC_API.'/index.php', 500000, $postdata, '', TRUE, UC_IP, 20);
}
function error($errstr) {
public static function error($errstr) {
$variable = array(
'uploadavatar' => $errstr,
);

View File

@ -13,7 +13,7 @@ if(!defined('IN_MOBILE_API')) {
class mobile_api_sub {
function getvariable() {
public static function getvariable() {
global $_G;
if(empty($_G['forum'])) {
$allowpost = 0;

View File

@ -12,7 +12,7 @@ define("REQUEST_METHOD_DOMAIN", 'http://wsq.discuz.com');
class mobile_core {
static function result($result) {
public static function result($result) {
global $_G;
ob_end_clean();
function_exists('ob_gzhandler') ? ob_start('ob_gzhandler') : ob_start();
@ -27,7 +27,7 @@ class mobile_core {
exit;
}
static function format($result) {
public static function format($result) {
switch (gettype($result)) {
case 'array':
foreach($result as $_k => $_v) {
@ -44,7 +44,7 @@ class mobile_core {
return $result;
}
static function json($encode) {
public static function json($encode) {
if(!empty($_GET['debug']) && defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) {
return debug($encode);
}
@ -52,7 +52,7 @@ class mobile_core {
return CJSON::encode($encode);
}
static function getvalues($variables, $keys, $subkeys = array()) {
public static function getvalues($variables, $keys, $subkeys = array()) {
$return = array();
foreach($variables as $key => $value) {
foreach($keys as $k) {
@ -172,7 +172,7 @@ class mobile_core {
return $xml;
}
static function diconv_array($variables, $in_charset, $out_charset) {
public static function diconv_array($variables, $in_charset, $out_charset) {
foreach($variables as $_k => $_v) {
if(is_array($_v)) {
$variables[$_k] = mobile_core::diconv_array($_v, $in_charset, $out_charset);
@ -183,7 +183,7 @@ class mobile_core {
return $variables;
}
static function make_cors($request_method, $origin = '') {
public static function make_cors($request_method, $origin = '') {
$origin = $origin ? $origin : REQUEST_METHOD_DOMAIN;
@ -218,7 +218,7 @@ class mobile_core {
}
static function usergroupIconId($groupid) {
public static function usergroupIconId($groupid) {
global $_G;
if($_G['cache']['usergroupIconId']) {
return $_G['cache']['usergroupIconId']['variable'][$groupid];
@ -249,7 +249,7 @@ class mobile_core {
}
}
static function activeHook($module, $mobileapihook, &$param, $isavariables = false) {
public static function activeHook($module, $mobileapihook, &$param, $isavariables = false) {
global $_G;
if($isavariables) {
$mobileapihook[$module] = array(
@ -462,6 +462,7 @@ class plugin_mobile_forum extends base_plugin_mobile_forum {
class plugin_mobile_misc extends base_plugin_mobile_misc {}
class mobileplugin_mobile extends base_plugin_mobile {
function global_header_mobile() {
global $_G;
if(in_array('mobileoem', $_G['setting']['plugins']['available'])) {
loadcache('mobileoem_data');
if($_G['cache']['mobileoem_data']['iframeUrl']) {

View File

@ -30,7 +30,7 @@ $defaultversions = array(
'wechat' => 4,
);
if(!in_array($_GET['module'], $modules)) {
if(!isset($_GET['module']) || !in_array($_GET['module'], $modules)) {
mobile_core::result(array('error' => 'module_not_exists'));
}
$_GET['version'] = !empty($_GET['version']) ? intval($_GET['version']) : (!$defaultversions[$_GET['module']] ? 1 : $defaultversions[$_GET['module']]);

View File

@ -594,7 +594,7 @@ class showActivity {
public static $init = false;
function init() {
public static function init() {
global $_G;
if(!$_G['wechat']['setting']['wsq_allow'] || !in_array($_G['tid'], (array)$_G['wechat']['setting']['showactivity']['tids'])) {
return false;