|
From: <be...@us...> - 2013-09-14 12:49:33
|
Revision: 12038
http://sourceforge.net/p/xoops/svn/12038
Author: beckmi
Date: 2013-09-14 12:49:29 +0000 (Sat, 14 Sep 2013)
Log Message:
-----------
Adding missing "static" to some class methods
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/auth/auth_provisionning.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/auth/authfactory.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/cache/xoopscache.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/captcha/xoopscaptcha.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/commentrenderer.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/database/sqlutility.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/model/xoopsmodel.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/module.errorhandler.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/utility/xoopsutility.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsblock.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopslocal.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/include/xoopslocal.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/kernel/module.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/kernel/user.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/cpanel.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/thumbs/phpthumb.class.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/class/ProtectorFilter.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/auth/auth_provisionning.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/auth/auth_provisionning.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/auth/auth_provisionning.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -38,12 +38,13 @@
* @param mixed $auth_instance
* @return
*/
- function &getInstance(&$auth_instance)
+ static function &getInstance(&$auth_instance)
{
static $provis_instance;
if (!isset($provis_instance)) {
$provis_instance = new XoopsAuthProvisionning($auth_instance);
}
+
return $provis_instance;
}
@@ -101,6 +102,7 @@
$xoopsUser = $this->change($xoopsUser, $datas, $uname, $pwd);
}
}
+
return $xoopsUser;
}
@@ -130,14 +132,16 @@
$newuser->setVar(trim($fields[0]), utf8_decode($datas[trim($fields[1])][0]));
}
if ($member_handler->insertUser($newuser)) {
- foreach($this->ldap_provisionning_group as $groupid) {
+ foreach ($this->ldap_provisionning_group as $groupid) {
$member_handler->addUserToGroup($groupid, $newuser->getVar('uid'));
}
$newuser->unsetNew();
+
return $newuser;
} else {
redirect_header(XOOPS_URL . '/user.php', 5, $newuser->getHtmlErrors());
}
+
return $ret;
}
@@ -163,6 +167,7 @@
} else {
redirect_header(XOOPS_URL . '/user.php', 5, $xoopsUser->getHtmlErrors());
}
+
return $ret;
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/auth/authfactory.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/auth/authfactory.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/auth/authfactory.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -39,7 +39,7 @@
* @static
* @return object Reference to the only instance of authentication class
*/
- function &getAuthConnection($uname)
+ static function &getAuthConnection($uname)
{
static $auth_instance;
if (!isset($auth_instance)) {
@@ -66,6 +66,7 @@
$class = 'XoopsAuth' . ucfirst($xoops_auth_method);
if (!class_exists($class)) {
$GLOBALS['xoopsLogger']->triggerError($class, _XO_ER_CLASSNOTFOUND, __FILE__, __LINE__, E_USER_ERROR );
+
return false;
}
switch ($xoops_auth_method) {
@@ -81,6 +82,7 @@
}
$auth_instance = new $class($dao);
}
+
return $auth_instance;
}
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/cache/xoopscache.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/cache/xoopscache.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/cache/xoopscache.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -36,7 +36,6 @@
var $engine = null;
// static $engine = null;
-
/**
* Cache configuration stack
*
@@ -73,6 +72,7 @@
$class = __CLASS__;
$instance = new $class();
}
+
return $instance;
}
@@ -90,18 +90,20 @@
include $file;
} else {
trigger_error('File :' . $file . ' not found in file : ' . __FILE__ . ' at line: ' . __LINE__, E_USER_WARNING);
+
return false;
}
}
+
return true;
}
/**
* Set the cache configuration to use
*
- * @param string $name Name of the configuration
- * @param array $settings Optional associative array of settings passed to the engine
- * @return array (engine, settings) on success, false on failure
+ * @param string $name Name of the configuration
+ * @param array $settings Optional associative array of settings passed to the engine
+ * @return array (engine, settings) on success, false on failure
* @access public
*/
function config($name = 'default', $settings = array())
@@ -113,9 +115,9 @@
if (isset($_this->configs[$name])) {
$settings = array_merge($_this->configs[$name], $settings);
- } else if (!empty($settings)) {
+ } elseif (!empty($settings)) {
$_this->configs[$name] = $settings;
- } else if ($_this->configs !== null && isset($_this->configs[$_this->name])) {
+ } elseif ($_this->configs !== null && isset($_this->configs[$_this->name])) {
$name = $_this->name;
$settings = $_this->configs[$_this->name];
} else {
@@ -135,6 +137,7 @@
if ($name !== $_this->name) {
if ($_this->engine($engine, $settings) === false) {
trigger_error("Cache Engine {$engine} is not set", E_USER_WARNING);
+
return false;
}
$_this->name = $name;
@@ -142,14 +145,15 @@
}
$settings = $_this->configs[$name];
+
return compact('engine', 'settings');
}
/**
* Set the cache engine to use or modify settings for one instance
*
- * @param string $name Name of the engine (without 'Engine')
- * @param array $settings Optional associative array of settings passed to the engine
+ * @param string $name Name of the engine (without 'Engine')
+ * @param array $settings Optional associative array of settings passed to the engine
* @return boolean True on success, false on failure
* @access public
*/
@@ -164,6 +168,7 @@
if (!isset($_this->engine[$name])) {
if ($_this->loadEngine($name) === false) {
trigger_error("Cache Engine {$name} is not loaded", E_USER_WARNING);
+
return false;
}
$_this->engine[$name] = new $cacheClass();
@@ -173,10 +178,12 @@
if (time() % $_this->engine[$name]->settings['probability'] == 0) {
$_this->engine[$name]->gc();
}
+
return true;
}
$_this->engine[$name] = null;
trigger_error("Cache Engine {$name} is not initialized", E_USER_WARNING);
+
return false;
}
@@ -198,21 +205,21 @@
/**
* Write data for key into cache
*
- * @param string $key Identifier for the data
- * @param mixed $value Data to be cached - anything except a resource
- * @param mixed $duration Optional - string configuration name OR how long to cache the data, either in seconds or a
+ * @param string $key Identifier for the data
+ * @param mixed $value Data to be cached - anything except a resource
+ * @param mixed $duration Optional - string configuration name OR how long to cache the data, either in seconds or a
* string that can be parsed by the strtotime() function OR array('config' => 'default', 'duration' => '3600')
* @return boolean True if the data was successfully cached, false on failure
* @access public
*/
- function write($key, $value, $duration = null)
+ static function write($key, $value, $duration = null)
{
$key = substr(md5(XOOPS_URL), 0, 8) . '_' . $key;
$_this =& XoopsCache::getInstance();
$config = null;
if (is_array($duration)) {
extract($duration);
- } else if (isset($_this->configs[$duration])) {
+ } elseif (isset($_this->configs[$duration])) {
$config = $duration;
$duration = null;
}
@@ -225,6 +232,7 @@
if (!$_this->isInitialized($engine)) {
trigger_error('Cache write not initialized: ' . $engine);
+
return false;
}
@@ -246,15 +254,16 @@
}
$_this->engine[$engine]->init($settings);
$success = $_this->engine[$engine]->write($key, $value, $duration);
+
return $success;
}
/**
* Read a key from the cache
*
- * @param string $key Identifier for the data
- * @param string $config name of the configuration to use
- * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
+ * @param string $key Identifier for the data
+ * @param string $config name of the configuration to use
+ * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
* @access public
*/
static function read($key, $config = null)
@@ -277,18 +286,19 @@
}
$_this->engine[$engine]->init($settings);
$success = $_this->engine[$engine]->read($key);
+
return $success;
}
/**
* Delete a key from the cache
*
- * @param string $key Identifier for the data
- * @param string $config name of the configuration to use
+ * @param string $key Identifier for the data
+ * @param string $config name of the configuration to use
* @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed
* @access public
*/
- function delete($key, $config = null)
+ static function delete($key, $config = null)
{
$key = substr(md5(XOOPS_URL), 0, 8) . '_' . $key;
$_this =& XoopsCache::getInstance();
@@ -306,14 +316,15 @@
$_this->engine[$engine]->init($settings);
$success = $_this->engine[$engine]->delete($key);
+
return $success;
}
/**
* Delete all keys from the cache
*
- * @param boolean $check if true will check expiration, otherwise delete all
- * @param string $config name of the configuration to use
+ * @param boolean $check if true will check expiration, otherwise delete all
+ * @param string $config name of the configuration to use
* @return boolean True if the cache was succesfully cleared, false otherwise
* @access public
*/
@@ -328,14 +339,15 @@
}
$success = $_this->engine[$engine]->clear($check);
$_this->engine[$engine]->init($settings);
+
return $success;
}
/**
* Check if Cache has initialized a working storage engine
*
- * @param string $engine Name of the engine
- * @param string $config Name of the configuration setting
+ * @param string $engine Name of the engine
+ * @param string $config Name of the configuration setting
* @return bool
* @access public
*/
@@ -352,8 +364,8 @@
/**
* Return the settings for current cache engine
*
- * @param string $engine Name of the engine
- * @return array list of settings for this engine
+ * @param string $engine Name of the engine
+ * @return array list of settings for this engine
* @access public
*/
function settings($engine = null)
@@ -365,14 +377,15 @@
if (isset($_this->engine[$engine]) && ! is_null($_this->engine[$engine])) {
return $_this->engine[$engine]->settings();
}
+
return array();
}
/**
* generates a safe key
*
- * @param string $key the key passed over
- * @return mixed string $key or false
+ * @param string $key the key passed over
+ * @return mixed string $key or false
* @access private
*/
function key($key)
@@ -381,6 +394,7 @@
return false;
}
$key = str_replace(array('/', '.'), '_', strval($key));
+
return $key;
}
}
@@ -406,7 +420,7 @@
*
* Called automatically by the cache frontend
*
- * @param array $params Associative array of parameters for the engine
+ * @param array $params Associative array of parameters for the engine
* @return boolean True if the engine has been succesfully initialized, false if not
* @access public
*/
@@ -415,6 +429,7 @@
$this->settings = array_merge(array(
'duration' => 31556926 ,
'probability' => 100), $settings);
+
return true;
}
@@ -432,9 +447,9 @@
/**
* Write value for a key into cache
*
- * @param string $key Identifier for the data
- * @param mixed $value Data to be cached
- * @param mixed $duration How long to cache the data, in seconds
+ * @param string $key Identifier for the data
+ * @param mixed $value Data to be cached
+ * @param mixed $duration How long to cache the data, in seconds
* @return boolean True if the data was succesfully cached, false on failure
* @access public
*/
@@ -446,8 +461,8 @@
/**
* Read a key from the cache
*
- * @param string $key Identifier for the data
- * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
+ * @param string $key Identifier for the data
+ * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
* @access public
*/
function read($key)
@@ -458,7 +473,7 @@
/**
* Delete a key from the cache
*
- * @param string $key Identifier for the data
+ * @param string $key Identifier for the data
* @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed
* @access public
*/
@@ -469,7 +484,7 @@
/**
* Delete all keys from the cache
*
- * @param boolean $check if true will check expiration, otherwise delete all
+ * @param boolean $check if true will check expiration, otherwise delete all
* @return boolean True if the cache was succesfully cleared, false otherwise
* @access public
*/
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/captcha/xoopscaptcha.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/captcha/xoopscaptcha.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/captcha/xoopscaptcha.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -60,13 +60,14 @@
*
* @return Instance
*/
- function &getInstance()
+ static function &getInstance()
{
static $instance;
if (!isset($instance)) {
$class = __CLASS__;
$instance = new $class();
}
+
return $instance;
}
@@ -92,6 +93,7 @@
foreach ($config as $key => $val) {
$config[$key] = $val;
}
+
return $config;
}
@@ -107,16 +109,19 @@
}
if (!empty($this->config['disabled'])) {
$this->active = false;
+
return $this->active;
}
if (!empty($this->config['skipmember']) && is_object($GLOBALS['xoopsUser'])) {
$this->active = false;
+
return $this->active;
}
if (!isset($this->handler)) {
$this->loadHandler();
}
$this->active = isset($this->handler);
+
return $this->active;
}
@@ -151,6 +156,7 @@
$this->handler = $handler;
$this->handler->loadConfig($name);
}
+
return $this->handler;
}
@@ -165,6 +171,7 @@
foreach ($configs as $key => $val) {
$this->setConfig($key, $val);
}
+
return true;
}
@@ -182,6 +189,7 @@
} else {
$this->config[$name] = $val;
}
+
return true;
}
@@ -206,10 +214,10 @@
if (!$this->isActive()) {
$is_valid = true;
// Skip CAPTCHA for member if set
- } else if (is_object($GLOBALS['xoopsUser']) && ! empty($skipMember)) {
+ } elseif (is_object($GLOBALS['xoopsUser']) && ! empty($skipMember)) {
$is_valid = true;
// Kill too many attempts
- } else if (!empty($maxAttempts) && $attempt > $maxAttempts) {
+ } elseif (!empty($maxAttempts) && $attempt > $maxAttempts) {
$this->message[] = _CAPTCHA_TOOMANYATTEMPTS;
// Verify the code
} else {
@@ -226,6 +234,7 @@
$_SESSION["{$sessionName}_attempt"] = null;
}
$this->destroyGarbage(true);
+
return $is_valid;
}
@@ -294,6 +303,7 @@
} else {
$form = $this->loadForm();
}
+
return $form;
}
@@ -307,6 +317,7 @@
if (!$this->active || empty($this->config['name'])) {
return '';
}
+
return $this->handler->renderValidationJS();
}
@@ -321,8 +332,10 @@
$code = ($code === null) ? $this->handler->getCode() : $code;
if (!empty($code)) {
$_SESSION[$this->name . '_code'] = $code;
+
return true;
}
+
return false;
}
@@ -335,6 +348,7 @@
{
$form = $this->handler->render();
$this->setCode();
+
return $form;
}
}
@@ -432,6 +446,7 @@
$func = !empty($this->config['casesensitive']) ? 'strcmp' : 'strcasecmp';
$is_valid = !$func(trim(@$_POST[$sessionName]), $_SESSION["{$sessionName}_code"]);
}
+
return $is_valid;
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/commentrenderer.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/commentrenderer.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/commentrenderer.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -62,17 +62,18 @@
/**
* Access the only instance of this class
*
- * @param object $tpl reference to a {@link Smarty} object
+ * @param object $tpl reference to a {@link Smarty} object
* @param boolean $use_icons
* @param boolean $do_iconcheck
* @return
*/
- function &instance(&$tpl, $use_icons = true, $do_iconcheck = false)
+ static function &instance(&$tpl, $use_icons = true, $do_iconcheck = false)
{
static $instance;
if (!isset($instance)) {
$instance = new XoopsCommentRenderer($tpl, $use_icons, $do_iconcheck);
}
+
return $instance;
}
@@ -106,13 +107,13 @@
// Start edit by voltan
$poster = $this->_getPosterArray($this->_comments[$i]->getVar('com_uid'), $this->_comments[$i]->getVar('com_user'), $this->_comments[$i]->getVar('com_url'));
if (false != $admin_view) {
- $com_email = $this->_comments[$i]->getVar('com_email');
+ $com_email = $this->_comments[$i]->getVar('com_email');
$text = $this->_comments[$i]->getVar('com_text');
$text .= '<div style="text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;">';
$text .= _CM_STATUS . ': ' . $this->_statusText[$this->_comments[$i]->getVar('com_status')] . '<br />';
$text .= 'IP: <span style="font-weight: bold;">' . $this->_comments[$i]->getVar('com_ip') . '</span>';
- if(!empty($com_email)) {
- $text .= '<br />' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>';
+ if (!empty($com_email)) {
+ $text .= '<br />' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>';
}
$text .= '</div>';
} else {
@@ -163,8 +164,8 @@
$text .= '<div style="text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;">';
$text .= _CM_STATUS . ': ' . $this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')] . '<br />';
$text .= 'IP: <span style="font-weight: bold;">' . $tree[$comment_id]['obj']->getVar('com_ip') . '</span>';
- if(!empty($com_email)) {
- $text .= '<br />' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>';
+ if (!empty($com_email)) {
+ $text .= '<br />' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>';
}
$text .= '</div>';
} else {
@@ -176,6 +177,7 @@
$this->renderThreadView($child_id, $admin_view, false);
}
}
+
return;
} else {
$text = $tree[$comment_id]['obj']->getVar('com_text');
@@ -193,12 +195,12 @@
* Render replies to a thread
*
* @param array $ &$thread
- * @param int $key
- * @param array $replies
- * @param string $prefix
- * @param bool $admin_view
+ * @param int $key
+ * @param array $replies
+ * @param string $prefix
+ * @param bool $admin_view
* @param integer $depth
- * @param string $current_prefix
+ * @param string $current_prefix
* @access private
*/
function _renderThreadReplies(&$thread, $key, &$replies, $prefix, $admin_view, $depth = 0, $current_prefix = '')
@@ -251,13 +253,13 @@
$title = $tree[$comment_id]['obj']->getVar('com_title');
}
if (false != $admin_view) {
- $com_email = $tree[$comment_id]['obj']->getVar('com_email');
+ $com_email = $tree[$comment_id]['obj']->getVar('com_email');
$text = $tree[$comment_id]['obj']->getVar('com_text');
$text .= '<div style="text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;">';
$text .= _CM_STATUS . ': ' . $this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')] . '<br />';
$text .= 'IP: <span style="font-weight: bold;">' . $tree[$comment_id]['obj']->getVar('com_ip') . '</span>';
- if(!empty($com_email)) {
- $text .= '<br />' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>';
+ if (!empty($com_email)) {
+ $text .= '<br />' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>';
}
$text .= '</div>';
} else {
@@ -269,6 +271,7 @@
$this->renderNestView($child_id, $admin_view);
}
}
+
return;
} else {
$text = $tree[$comment_id]['obj']->getVar('com_text');
@@ -284,11 +287,11 @@
/**
* Render replies in nested view
*
- * @param array $thread
- * @param int $key
- * @param array $replies
- * @param string $prefix
- * @param bool $admin_view
+ * @param array $thread
+ * @param int $key
+ * @param array $replies
+ * @param string $prefix
+ * @param bool $admin_view
* @param integer $depth
* @access private
*/
@@ -326,7 +329,7 @@
/**
* Get the name of the poster
*
- * @param int $poster_id
+ * @param int $poster_id
* @return string
* @access private
*/
@@ -341,15 +344,15 @@
}
} elseif ($poster['id'] == 0 && $poster_user != '') {
- $poster['id'] = 0; // to cope with deleted user accounts
- if(!empty($poster_website)) {
- $poster['uname'] = '<a href="' . $poster_website . '">' . $poster_user . '</a>';
- } else {
- $poster['uname'] = $poster_user;
- }
+ $poster['id'] = 0; // to cope with deleted user accounts
+ if (!empty($poster_website)) {
+ $poster['uname'] = '<a href="' . $poster_website . '">' . $poster_user . '</a>';
+ } else {
+ $poster['uname'] = $poster_user;
+ }
} else {
- $poster['id'] = 0; // to cope with deleted user accounts
- $poster['uname'] = $GLOBALS['xoopsConfig']['anonymous'];
+ $poster['id'] = 0; // to cope with deleted user accounts
+ $poster['uname'] = $GLOBALS['xoopsConfig']['anonymous'];
}
return $poster;
@@ -359,7 +362,7 @@
/**
* Get an array with info about the poster
*
- * @param int $poster_id
+ * @param int $poster_id
* @return array
* @access private
*/
@@ -381,27 +384,27 @@
$poster['status'] = $com_poster->isOnline() ? _CM_ONLINE : '';
}
} elseif ($poster['id'] == 0 && $poster_user != '') {
- if(!empty($poster_website)) {
- $poster['uname'] = '<a href="' . $poster_website . '">' . $poster_user . '</a>';
- } else {
- $poster['uname'] = $poster_user;
- }
- $poster['id'] = 0; // to cope with deleted user accounts
- $poster['rank_title'] = '';
- $poster['avatar'] = 'blank.gif';
- $poster['regdate'] = '';
- $poster['from'] = '';
- $poster['postnum'] = 0;
- $poster['status'] = '';
+ if (!empty($poster_website)) {
+ $poster['uname'] = '<a href="' . $poster_website . '">' . $poster_user . '</a>';
+ } else {
+ $poster['uname'] = $poster_user;
+ }
+ $poster['id'] = 0; // to cope with deleted user accounts
+ $poster['rank_title'] = '';
+ $poster['avatar'] = 'blank.gif';
+ $poster['regdate'] = '';
+ $poster['from'] = '';
+ $poster['postnum'] = 0;
+ $poster['status'] = '';
} else {
- $poster['uname'] = $GLOBALS['xoopsConfig']['anonymous'];
- $poster['id'] = 0; // to cope with deleted user accounts
- $poster['rank_title'] = '';
- $poster['avatar'] = 'blank.gif';
- $poster['regdate'] = '';
- $poster['from'] = '';
- $poster['postnum'] = 0;
- $poster['status'] = '';
+ $poster['uname'] = $GLOBALS['xoopsConfig']['anonymous'];
+ $poster['id'] = 0; // to cope with deleted user accounts
+ $poster['rank_title'] = '';
+ $poster['avatar'] = 'blank.gif';
+ $poster['regdate'] = '';
+ $poster['from'] = '';
+ $poster['postnum'] = 0;
+ $poster['status'] = '';
}
return $poster;
@@ -411,7 +414,7 @@
/**
* Get the IMG tag for the title icon
*
- * @param string $icon_image
+ * @param string $icon_image
* @return string HTML IMG tag
* @access private
*/
@@ -429,6 +432,7 @@
return '<img src="' . XOOPS_URL . '/images/subject/' . $icon_image . '" alt="" />';
}
}
+
return '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />';
}
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/database/sqlutility.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/database/sqlutility.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/database/sqlutility.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -40,7 +40,7 @@
* @return boolean always true
* @access public
*/
- function splitMySqlFile(&$ret, $sql)
+ static function splitMySqlFile(&$ret, $sql)
{
$sql = trim($sql);
$sql_len = strlen($sql);
@@ -152,7 +152,7 @@
* @param string $prefix prefix to add to all table names
* @return mixed FALSE on failure
*/
- function prefixQuery($query, $prefix)
+ static function prefixQuery($query, $prefix)
{
$pattern = "/^(INSERT[\s]+INTO|CREATE[\s]+TABLE|ALTER[\s]+TABLE|UPDATE)(\s)+([`]?)([^`\s]+)\\3(\s)+/siU";
$pattern2 = "/^(DROP TABLE)(\s)+([`]?)([^`\s]+)\\3(\s)?$/siU";
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/model/xoopsmodel.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/model/xoopsmodel.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/model/xoopsmodel.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -59,6 +59,7 @@
$class = __CLASS__;
$instance = new $class();
}
+
return $instance;
}
@@ -66,12 +67,12 @@
* Load object handler
*
* @access public
- * @param object $ohandler reference to {@link XoopsPersistableObjectHandler}
- * @param string $name handler name
- * @param mixed $args args
+ * @param object $ohandler reference to {@link XoopsPersistableObjectHandler}
+ * @param string $name handler name
+ * @param mixed $args args
* @return object of handler
*/
- function loadHandler($ohander, $name, $args = null)
+ static function loadHandler($ohander, $name, $args = null)
{
static $handlers;
if (!isset($handlers[$name])) {
@@ -79,11 +80,12 @@
include_once $file;
$className = 'XoopsModel' . ucfirst($name);
$handler = new $className();
- } else if (xoops_load('model', 'framework')) {
+ } elseif (xoops_load('model', 'framework')) {
$handler = XoopsModel::loadHandler($name);
}
if (!is_object($handler)) {
trigger_error('Handler not found in file ' . __FILE__ . 'at line ' . __LINE__, E_USER_WARNING);
+
return null;
}
$handlers[$name] = $handler;
@@ -92,6 +94,7 @@
if (!empty($args) && is_array($args) && is_a($handlers[$name], 'XoopsModelAbstract')) {
$handlers[$name]->setVars($args);
}
+
return $handlers[$name];
}
}
@@ -148,8 +151,10 @@
{
if (is_object($handler) && is_a($handler, 'XoopsPersistableObjectHandler')) {
$this->handler =& $handler;
+
return true;
}
+
return false;
}
@@ -166,6 +171,7 @@
$this->$key = $value;
}
}
+
return true;
}
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/module.errorhandler.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/module.errorhandler.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/module.errorhandler.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -22,7 +22,6 @@
$GLOBALS['xoopsLogger']->addDeprecated("'/class/module.errorhandler.php' is deprecated since XOOPS 2.5.4, please create your own error messages instead.");
-
/**
* Error Handler class
*
@@ -35,11 +34,11 @@
/**
* Show an error message
*
- * @param string $e_code Errorcode
- * @param integer $pages How many pages should the link take you back?
+ * @param string $e_code Errorcode
+ * @param integer $pages How many pages should the link take you back?
* @global $xoopsConfig
*/
- function show($e_code, $pages = 1)
+ static function show($e_code, $pages = 1)
{
global $xoopsConfig;
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/utility/xoopsutility.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/utility/xoopsutility.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/utility/xoopsutility.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -45,19 +45,20 @@
$this->__construct();
}
- /**
+ /**
* XoopsUtility::recursive()
*
* @param mixed $handler
* @param mixed $data
* @return
*/
- function recursive($handler, $data)
+ static function recursive($handler, $data)
{
if (is_array($data)) {
$return = array_map(array(
'XoopsUtility' ,
'recursive'), $handler, $data);
+
return $return;
}
// single function
@@ -70,6 +71,7 @@
$handler[0] ,
$handler[1]), $data);
}
+
return $data;
}
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsblock.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsblock.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsblock.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -108,11 +108,13 @@
}
if (!$this->db->query($sql)) {
$this->setErrors("Could not save block data into database");
+
return false;
}
if (empty($bid)) {
$bid = $this->db->getInsertId();
}
+
return $bid;
}
@@ -131,6 +133,7 @@
$this->db->query($sql);
$sql = sprintf("DELETE FROM %s WHERE block_id = %u", $this->db->prefix('block_module_link'), $this->getVar('bid'));
$this->db->query($sql);
+
return true;
}
@@ -152,19 +155,22 @@
// T : use text sanitizater (smilies disabled)
if ($c_type == 'H') {
return str_replace('{X_SITEURL}', XOOPS_URL . '/', $this->getVar('content', 'n'));
- } else if ($c_type == 'P') {
+ } elseif ($c_type == 'P') {
ob_start();
echo eval($this->getVar('content', 'n'));
$content = ob_get_contents();
ob_end_clean();
+
return str_replace('{X_SITEURL}', XOOPS_URL . '/', $content);
- } else if ($c_type == 'S') {
+ } elseif ($c_type == 'S') {
$myts =& MyTextSanitizer::getInstance();
$content = str_replace('{X_SITEURL}', XOOPS_URL . '/', $this->getVar('content', 'n'));
+
return $myts->displayTarea($content, 1, 1);
} else {
$myts =& MyTextSanitizer::getInstance();
$content = str_replace('{X_SITEURL}', XOOPS_URL . '/', $this->getVar('content', 'n'));
+
return $myts->displayTarea($content, 1, 0);
}
break;
@@ -210,13 +216,14 @@
} else {
return false;
}
- } else {
+ } else {
// it is a custom block, so just return the contents
$block['content'] = $this->getContent('s', $this->getVar('c_type'));
if (empty($block['content'])) {
return false;
}
}
+
return $block;
}
@@ -231,17 +238,18 @@
{
if ($position == 0) {
$ret = $contentdb . $content;
- } else if ($position == 1) {
+ } elseif ($position == 1) {
$ret = $content . $contentdb;
}
+
return $ret;
}
/**
* Enter description here...
*
- * @param string $originaltitle
- * @param string $newtitle
+ * @param string $originaltitle
+ * @param string $newtitle
* @return string title
*/
function buildTitle($originaltitle, $newtitle = '')
@@ -251,6 +259,7 @@
} else {
$ret = $originaltitle;
}
+
return $ret;
}
@@ -291,6 +300,7 @@
if (!$edit_form) {
return false;
}
+
return $edit_form;
} else {
return false;
@@ -314,7 +324,7 @@
* @param $orderby order of the blocks
* @returns array of block objects
*/
- function getAllBlocksByGroup($groupid, $asobject = true, $side = null, $visible = null, $orderby = "b.weight,b.bid", $isactive = 1)
+ static function getAllBlocksByGroup($groupid, $asobject = true, $side = null, $visible = null, $orderby = "b.weight,b.bid", $isactive = 1)
{
$db =& XoopsDatabaseFactory::getDatabaseConnection();
$ret = array();
@@ -328,7 +338,7 @@
$sql .= " AND (l.gperm_groupid=" . $groupid[0] . "";
$size = count($groupid);
if ($size > 1) {
- for($i = 1; $i < $size; $i ++) {
+ for ($i = 1; $i < $size; $i ++) {
$sql .= " OR l.gperm_groupid=" . $groupid[$i] . "";
}
}
@@ -364,16 +374,17 @@
array_push($added, $myrow['bid']);
}
}
+
return $ret;
}
/**
* XoopsBlock::getAllBlocks()
*
- * @param string $rettype
- * @param mixed $side
- * @param mixed $visible
- * @param string $orderby
+ * @param string $rettype
+ * @param mixed $side
+ * @param mixed $visible
+ * @param string $orderby
* @param integer $isactive
* @return
*/
@@ -434,7 +445,7 @@
* @param mixed $asobject
* @return
*/
- function getByModule($moduleid, $asobject = true)
+ static function getByModule($moduleid, $asobject = true)
{
$moduleid = intval($moduleid);
$db =& XoopsDatabaseFactory::getDatabaseConnection();
@@ -452,17 +463,18 @@
$ret[] = $myrow['bid'];
}
}
+
return $ret;
}
/**
* XoopsBlock::getAllByGroupModule()
*
- * @param mixed $groupid
+ * @param mixed $groupid
* @param integer $module_id
- * @param mixed $toponlyblock
- * @param mixed $visible
- * @param string $orderby
+ * @param mixed $toponlyblock
+ * @param mixed $visible
+ * @param string $orderby
* @param integer $isactive
* @return
*/
@@ -495,7 +507,7 @@
$sql .= ' AND b.visible=' . intval($visible);
}
if (!isset($module_id)) {
- } else if (!empty($module_id)) {
+ } elseif (!empty($module_id)) {
$sql .= ' AND m.module_id IN (0,' . intval($module_id);
if ($toponlyblock) {
$sql .= ',-1';
@@ -518,6 +530,7 @@
$ret[$myrow['bid']] = & $block;
unset($block);
}
+
return $ret;
}
@@ -525,9 +538,9 @@
* XoopsBlock::getNonGroupedBlocks()
*
* @param integer $module_id
- * @param mixed $toponlyblock
- * @param mixed $visible
- * @param string $orderby
+ * @param mixed $toponlyblock
+ * @param mixed $visible
+ * @param string $orderby
* @param integer $isactive
* @return
*/
@@ -557,7 +570,7 @@
$sql .= ' AND b.visible=' . intval($visible);
}
if (!isset($module_id)) {
- } else if (!empty($module_id)) {
+ } elseif (!empty($module_id)) {
$sql .= ' AND m.module_id IN (0,' . intval($module_id);
if ($toponlyblock) {
$sql .= ',-1';
@@ -579,6 +592,7 @@
unset($block);
}
}
+
return $ret;
}
@@ -609,6 +623,7 @@
return 0;
}
list ($count) = $db->fetchRow($result);
+
return $count;
}
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopslocal.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopslocal.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopslocal.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -24,19 +24,20 @@
/**
* XoopsLocalAbstract::substr()
*
- * @param mixed $str
- * @param mixed $start
- * @param mixed $length
+ * @param mixed $str
+ * @param mixed $start
+ * @param mixed $length
* @param string $trimmarker
* @return
*/
- function substr($str, $start, $length, $trimmarker = '...')
+ static function substr($str, $start, $length, $trimmarker = '...')
{
if (! XOOPS_USE_MULTIBYTES) {
return (strlen($str) - $start <= $length) ? substr($str, $start, $length) : substr($str, $start, $length - strlen($trimmarker)) . $trimmarker;
}
if (function_exists('mb_internal_encoding') && @mb_internal_encoding(_CHARSET)) {
$str2 = mb_strcut($str, $start, $length - strlen($trimmarker));
+
return $str2 . (mb_strlen($str) != mb_strlen($str2) ? $trimmarker : '');
}
@@ -49,25 +50,26 @@
* @param mixed $text
* @return
*/
- function utf8_encode($text)
+ static function utf8_encode($text)
{
if (XOOPS_USE_MULTIBYTES == 1) {
if (function_exists('mb_convert_encoding')) {
return mb_convert_encoding($text, 'UTF-8', 'auto');
}
}
+
return utf8_encode($text);
}
/**
* XoopsLocalAbstract::convert_encoding()
*
- * @param mixed $text
+ * @param mixed $text
* @param string $to
* @param string $from
* @return
*/
- function convert_encoding($text, $to = 'utf-8', $from = '')
+ static function convert_encoding($text, $to = 'utf-8', $from = '')
{
if (empty($text)) {
return $text;
@@ -87,6 +89,7 @@
$converted_text = utf8_encode($text);
}
$text = empty($converted_text) ? $text : $converted_text;
+
return $text;
}
@@ -96,9 +99,10 @@
* @param mixed $text
* @return
*/
- function trim($text)
+ static function trim($text)
{
$ret = trim($text);
+
return $ret;
}
@@ -115,7 +119,7 @@
*
* Setting $timeoffset to null (by default) will skip timezone calculation for user, using default timezone instead, which is a MUST for cached contents
*/
- function formatTimestamp($time, $format = 'l', $timeoffset = null)
+ static function formatTimestamp($time, $format = 'l', $timeoffset = null)
{
global $xoopsConfig, $xoopsUser;
@@ -130,6 +134,7 @@
$TIME_ZONE = $prefix . date('Hi', $server_TZ);
}
$date = gmdate('D, d M Y H:i:s', intval($time)) . $TIME_ZONE;
+
return $date;
}
@@ -146,6 +151,7 @@
$num = $seconds > 1 ? sprintf(_SECONDS, $seconds) : _SECOND;
}
$ret = sprintf(_ELAPSE, $num);
+
return $ret;
}
// disable user timezone calculation and use default timezone,
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/include/xoopslocal.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/include/xoopslocal.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/include/xoopslocal.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -24,7 +24,7 @@
*/
class XoopsLocalWrapper
{
- function load($language = null)
+ static function load($language = null)
{
if (class_exists('Xoopslocal')) {
return true;
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/kernel/module.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/kernel/module.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/kernel/module.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -66,7 +66,7 @@
/**
* Load module info
*
- * @param string $dirname Directory Name
+ * @param string $dirname Directory Name
* @param boolean $verbose
*/
function loadInfoAsVar($dirname, $verbose = true)
@@ -119,9 +119,9 @@
/**
* Set module info
*
- * @param string $name
- * @param mix $value
- * @return bool
+ * @param string $name
+ * @param mix $value
+ * @return bool
**/
function setInfo($name, $value)
{
@@ -130,14 +130,15 @@
} else {
$this->modinfo[$name] = $value;
}
+
return true;
}
/**
* Get module info
*
- * @param string $name
- * @return array |string Array of module information.
+ * @param string $name
+ * @return array |string Array of module information.
* If {@link $name} is set, returns a single module information item as string.
*/
function &getInfo($name = null)
@@ -150,8 +151,10 @@
return $this->modinfo[$name];
}
$return = false;
+
return $return;
}
+
return $this->modinfo;
}
@@ -164,8 +167,10 @@
{
if ($this->getVar('hasmain') == 1) {
$ret = '<a href="' . XOOPS_URL . '/modules/' . $this->getVar('dirname') . '/">' . $this->getVar('name') . '</a>';
+
return $ret;
}
+
return false;
}
@@ -184,6 +189,7 @@
'url' => $submenu['url']);
}
}
+
return $ret;
}
@@ -209,6 +215,7 @@
if (!isset($this->adminmenu)) {
$this->loadAdminMenu();
}
+
return $this->adminmenu;
}
@@ -216,7 +223,7 @@
* Load the module info for this module
*
* @param string $dirname Module directory
- * @param bool $verbose Give an error on fail?
+ * @param bool $verbose Give an error on fail?
*/
function loadInfo($dirname, $verbose = true)
{
@@ -224,7 +231,7 @@
global $xoopsConfig;
if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/language/' . $xoopsConfig['language'] . '/modinfo.php'))) {
include_once $file;
- } else if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/language/english/modinfo.php'))) {
+ } elseif (file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/language/english/modinfo.php'))) {
include_once $file;
}
@@ -232,22 +239,24 @@
if (false != $verbose) {
echo "Module File for $dirname Not Found!";
}
+
return false;
}
include $file;
$this->modinfo = $modversion;
+
return true;
}
/**
* Search contents within a module
*
- * @param string $term
- * @param string $andor 'AND' or 'OR'
- * @param integer $limit
- * @param integer $offset
- * @param integer $userid
- * @return mixed Search result.
+ * @param string $term
+ * @param string $andor 'AND' or 'OR'
+ * @param integer $limit
+ * @param integer $offset
+ * @param integer $userid
+ * @return mixed Search result.
*/
function search($term = '', $andor = 'AND', $limit = 0, $offset = 0, $userid = 0)
{
@@ -265,8 +274,10 @@
}
if (function_exists($search['func'])) {
$func = $search['func'];
+
return $func($term, $andor, $limit, $offset, $userid);
}
+
return false;
}
@@ -382,10 +393,11 @@
return $this->getVar('hasnotification', $format);
}
- function &getByDirName($dirname)
+ static function &getByDirName($dirname)
{
$modhandler =& xoops_gethandler('module');
$inst =& $modhandler->getByDirname($dirname);
+
return $inst;
}
@@ -397,96 +409,112 @@
function checkAccess()
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function loadLanguage($type = "main")
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function loadErrorMessages()
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function getCurrentPage()
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function install($admingroups = array(), $accessgroups = array())
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function update()
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function insert()
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function executeSQL()
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function insertTemplates()
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function gettemplate($template, $block = false)
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function insertBlocks()
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function insertConfigCategories()
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function insertConfig()
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function insertProfileFields()
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function executeScript($type, $state = 2)
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
function insertGroupPermissions($groups, $type)
{
trigger_error(__CLASS__ . "::" . __FUNCTION__ . ' is deprecated', E_USER_WARNING);
+
return false;
}
/**#@-*/
@@ -523,7 +551,7 @@
/**
* Create a new {@link XoopsModule} object
*
- * @param boolean $isNew Flag the new object as "new"
+ * @param boolean $isNew Flag the new object as "new"
* @return object
*/
function &create($isNew = true)
@@ -532,13 +560,14 @@
if ($isNew) {
$module->setNew();
}
+
return $module;
}
/**
* Load a module from the database
*
- * @param int $id ID of the module
+ * @param int $id ID of the module
* @return object FALSE on fail
*/
function &get($id)
@@ -562,17 +591,19 @@
$module->assignVars($myrow);
$_cachedModule_mid[$id] = &$module;
$_cachedModule_dirname[$module->getVar('dirname')] = &$module;
+
return $module;
}
}
}
+
return $module;
}
/**
* Load a module by its dirname
*
- * @param string $dirname
+ * @param string $dirname
* @return object FALSE on fail
*/
function &getByDirname($dirname)
@@ -600,6 +631,7 @@
$_cachedModule_dirname[$dirname] =& $module;
$_cachedModule_mid[$module->getVar('mid')] =& $module;
}
+
return $module;
}
}
@@ -647,6 +679,7 @@
if (!empty($this->_cachedModule_mid[$mid])) {
unset($this->_cachedModule_mid[$mid]);
}
+
return true;
}
@@ -709,14 +742,15 @@
if (!empty($this->_cachedModule_mid[$module->getVar('mid')])) {
unset($this->_cachedModule_mid[$module->getVar('mid')]);
}
+
return true;
}
/**
* Load some modules
*
- * @param object $criteria {@link CriteriaElement}
- * @param boolean $id_as_key Use the ID as key into the array
+ * @param object $criteria {@link CriteriaElement}
+ * @param boolean $id_as_key Use the ID as key into the array
* @return array
*/
function getObjects($criteria = null, $id_as_key = false)
@@ -744,13 +778,14 @@
}
unset($module);
}
+
return $ret;
}
/**
* Count some modules
*
- * @param object $criteria {@link CriteriaElement}
+ * @param object $criteria {@link CriteriaElement}
* @return int
*/
function getCount($criteria = null)
@@ -763,13 +798,14 @@
return 0;
}
list ($count) = $this->db->fetchRow($result);
+
return $count;
}
/**
* returns an array of module names
*
- * @param bool $criteria
+ * @param bool $criteria
* @param boolean $dirname_as_key if true, array keys will be module directory names
* if false, array keys will be module id
* @return array
@@ -785,6 +821,7 @@
$ret[$modules[$i]->getVar('dirname')] = $modules[$i]->getVar('name');
}
}
+
return $ret;
}
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/kernel/user.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/kernel/user.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/kernel/user.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -121,7 +121,7 @@
* @param int $usereal switch for usename or realname
* @return string name of the user. name for 'anonymous' if not found.
*/
- function getUnameFromId($userid, $usereal = 0)
+ static function getUnameFromId($userid, $usereal = 0)
{
$userid = intval($userid);
$usereal = intval($usereal);
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/cpanel.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/cpanel.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/cpanel.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -39,13 +39,14 @@
*
* @return unknown
*/
- function &getInstance()
+ static function &getInstance()
{
static $instance;
if (!isset($instance)) {
$class = __CLASS__;
$instance = new $class();
}
+
return $instance;
}
@@ -82,7 +83,7 @@
*
* @return unknown
*/
- function getGuis()
+ static function getGuis()
{
$guis = array();
xoops_load('XoopsLists');
@@ -97,6 +98,7 @@
}
}
}
+
return $guis;
}
@@ -104,7 +106,7 @@
* Flush the Xoops Admin Gui
*
*/
- function flush()
+ static function flush()
{
$guis = XoopsSystemCpanel::getGuis();
foreach ($guis as $gui) {
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/thumbs/phpthumb.class.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/thumbs/phpthumb.class.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/thumbs/phpthumb.class.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -610,7 +610,7 @@
}
if (headers_sent()) {
return $this->ErrorImage('OutputThumbnail() failed - headers already sent');
- exit;
+// exit;
}
$downloadfilename = phpthumb_functions::SanitizeFilename(is_string($this->sia) ? $this->sia : ($this->down ? $this->down : 'phpThumb_generated_thumbnail'.'.'.$this->thumbnailFormat));
@@ -1374,7 +1374,7 @@
// $UnAllowedParameters contains options that can only be processed in GD, not ImageMagick
// note: 'fltr' *may* need to be processed by GD, but we'll check that in more detail below
$UnAllowedParameters = array('xto', 'ar', 'bg', 'bc');
- // 'ra' may be part of this list, if not a multiple of 90\xB0
+ // 'ra' may be part of this list, if not a multiple of 90°
foreach ($UnAllowedParameters as $parameter) {
if (isset($this->$parameter)) {
$this->DebugMessage('$this->useRawIMoutput=false because "'.$parameter.'" is set', __FILE__, __LINE__);
@@ -3981,7 +3981,7 @@
return true;
}
- function ErrorImage($text, $width=0, $height=0, $forcedisplay=false)
+ static function ErrorImage($text, $width=0, $height=0, $forcedisplay=false)
{
$width = ($width ? $width : $this->config_error_image_width);
$height = ($height ? $height : $this->config_error_image_height);
@@ -4225,7 +4225,7 @@
return true;
}
- function phpThumb_tempnam()
+ static function phpThumb_tempnam()
{
$this->InitializeTempDirSetting();
$tempnam = realpath(tempnam($this->config_temp_directory, 'pThumb'));
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/class/ProtectorFilter.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/class/ProtectorFilter.php 2013-09-14 07:32:51 UTC (rev 12037)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/class/ProtectorFilter.php 2013-09-14 12:49:29 UTC (rev 12038)
@@ -43,7 +43,7 @@
$this->filters_base = dirname(dirname(__FILE__)).'/filters_enabled' ;
}
- function &getInstance()
+ static function &getInstance()
{
static $instance ;
if ( ! isset( $instance ) ) {
|