diff --git a/htdocs/Frameworks/art/functions.cache.php b/htdocs/Frameworks/art/functions.cache.php index beabbd589..d4e4aceed 100644 --- a/htdocs/Frameworks/art/functions.cache.php +++ b/htdocs/Frameworks/art/functions.cache.php @@ -14,7 +14,7 @@ define('FRAMEWORKS_ART_FUNCTIONS_CACHE', true); /** - * @param null|array $groups + * @param array|null $groups * * @return string */ @@ -37,7 +37,7 @@ function mod_generateCacheId_byGroup($groups = null) } /** - * @param null $groups + * @param mixed $groups * * @return string */ @@ -47,9 +47,9 @@ function mod_generateCacheId($groups = null) } /** - * @param $data - * @param null|string $name - * @param null|string $dirname + * @param mixed $data + * @param string|null $name + * @param string|null $dirname * @param string $root_path * * @return bool @@ -68,9 +68,9 @@ function mod_createFile($data, $name = null, $dirname = null, $root_path = XOOPS } /** - * @param $data - * @param null $name - * @param null $dirname + * @param mixed $data + * @param string|null $name + * @param string|null $dirname * * @return bool */ @@ -80,10 +80,10 @@ function mod_createCacheFile($data, $name = null, $dirname = null) } /** - * @param $data - * @param null|string $name - * @param null $dirname - * @param null $groups + * @param mixed $data + * @param string|null $name + * @param string|null $dirname + * @param mixed $groups * * @return bool */ @@ -95,8 +95,8 @@ function mod_createCacheFile_byGroup($data, $name = null, $dirname = null, $grou } /** - * @param $name - * @param null|string $dirname + * @param string $name + * @param string|null $dirname * @param string $root_path * * @return mixed|null @@ -118,10 +118,10 @@ function mod_loadFile($name, $dirname = null, $root_path = XOOPS_CACHE_PATH) } /** - * @param $name - * @param null $dirname + * @param string $name + * @param string|null $dirname * - * @return mixed|null + * @return mixed */ function mod_loadCacheFile($name, $dirname = null) { @@ -131,11 +131,11 @@ function mod_loadCacheFile($name, $dirname = null) } /** - * @param $name - * @param null $dirname - * @param null $groups + * @param string $name + * @param string|null $dirname + * @param mixed $groups * - * @return mixed|null + * @return mixed */ function mod_loadCacheFile_byGroup($name, $dirname = null, $groups = null) { @@ -149,7 +149,7 @@ function mod_loadCacheFile_byGroup($name, $dirname = null, $groups = null) /** * @param string $name - * @param null $dirname + * @param string|null $dirname * @param string $root_path * * @return bool @@ -178,7 +178,7 @@ function mod_clearFile($name = '', $dirname = null, $root_path = XOOPS_CACHE_PAT /** * @param string $name - * @param null $dirname + * @param string|null $dirname * * @return bool */ diff --git a/htdocs/Frameworks/art/functions.php b/htdocs/Frameworks/art/functions.php index afd7f4fdb..0efcaee69 100644 --- a/htdocs/Frameworks/art/functions.php +++ b/htdocs/Frameworks/art/functions.php @@ -31,7 +31,7 @@ * * In some cases mysql_get_client_info is required instead * - * @param null $conn + * @param mysqli|null $conn * * @return string */ diff --git a/htdocs/Frameworks/art/object.php b/htdocs/Frameworks/art/object.php index fb4b3d601..593640f49 100644 --- a/htdocs/Frameworks/art/object.php +++ b/htdocs/Frameworks/art/object.php @@ -80,7 +80,7 @@ public function __construct(XoopsMySQLDatabase $db, $table = '', $className = '' /** * get MySQL server version * - * @param null|XoopsDatabase|mysqli $conn + * @param XoopsDatabase|mysqli|null $conn * * @return string */ diff --git a/htdocs/class/auth/auth.php b/htdocs/class/auth/auth.php index 598b40154..190f69834 100644 --- a/htdocs/class/auth/auth.php +++ b/htdocs/class/auth/auth.php @@ -17,7 +17,9 @@ * @author Pierre-Eric MENUET */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * diff --git a/htdocs/class/auth/auth_ads.php b/htdocs/class/auth/auth_ads.php index 434c92282..a4e1887b5 100644 --- a/htdocs/class/auth/auth_ads.php +++ b/htdocs/class/auth/auth_ads.php @@ -17,7 +17,9 @@ * @author Pierre-Eric MENUET */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * diff --git a/htdocs/class/auth/auth_ldap.php b/htdocs/class/auth/auth_ldap.php index d8226ee8e..5791eaac1 100644 --- a/htdocs/class/auth/auth_ldap.php +++ b/htdocs/class/auth/auth_ldap.php @@ -16,7 +16,9 @@ * @since 2.0 * @author Pierre-Eric MENUET */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * @@ -157,19 +159,36 @@ class XoopsAuthLdap extends XoopsAuth * LATIN CAPITAL LETTER Y WITH DIAERESIS */ - public $ldap_server; - public $ldap_port = '389'; - public $ldap_version = '3'; - public $ldap_base_dn; - public $ldap_loginname_asdn; - public $ldap_loginldap_attr; - public $ldap_mail_attr; - public $ldap_name_attr; - public $ldap_surname_attr; - public $ldap_givenname_attr; - public $ldap_manager_dn; - public $ldap_manager_pass; - public $_ds; + public string $ldap_server; + public int $ldap_port = 389; + public string $ldap_version = '3'; + public string $ldap_base_dn; + public bool $ldap_loginname_asdn; + public string $ldap_loginldap_attr; + public string $ldap_mail_attr; + public string $ldap_name_attr; + public string $ldap_surname_attr; + public string $ldap_givenname_attr; + public string $ldap_manager_dn; + public string $ldap_manager_pass; + public string $ldap_filter_person; + public bool $ldap_use_TLS; + public string $ldap_domain_name; + public string $ldap_provisionning; + public string $ldap_provisionning_upd; + public array $ldap_provisionning_group; + public string $ldap_field_mapping; + public array $ldap_users_bypass; + public string $ldap_filter_person_adv; + public string $ldap_filter_attr; + public string $ldap_filter_value; + public string $ldap_filter_operator; + public string $ldap_filter_groupattr; + public string $ldap_filter_groupvalue; + public string $ldap_filter_member; + public string $ldap_filter_memberattr; + public string $ldap_filter_membervalue; + public mixed $_ds; /** * Authentication Service constructor @@ -285,7 +304,7 @@ public function getUserDN($uname) * Load user from XOOPS Database * * @param string $uname - * @return XoopsUser object + * @return string XoopsUser object */ public function getFilter($uname) { diff --git a/htdocs/class/auth/auth_provisionning.php b/htdocs/class/auth/auth_provisionning.php index 3e9c385a2..df7819d82 100644 --- a/htdocs/class/auth/auth_provisionning.php +++ b/htdocs/class/auth/auth_provisionning.php @@ -16,7 +16,9 @@ * @since 2.0 * @author Pierre-Eric MENUET */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * @@ -29,7 +31,15 @@ */ class XoopsAuthProvisionning { - protected $_auth_instance; + protected ?XoopsAuth $_auth_instance; + protected string $ldap_provisionning; + protected string $ldap_provisionning_upd; + protected array $ldap_provisionning_group; + protected string $ldap_field_mapping; + protected string $default_TZ; + protected string $theme_set; + protected string $com_mode; + protected string $com_order; /** * XoopsAuthProvisionning::getInstance() @@ -50,7 +60,7 @@ public static function getInstance(?XoopsAuth $auth_instance = null) /** * Authentication Service constructor - * @param XoopsAuth $auth_instance + * @param XoopsAuth|null $auth_instance */ public function __construct(?XoopsAuth $auth_instance = null) { @@ -71,8 +81,8 @@ public function __construct(?XoopsAuth $auth_instance = null) /** * Return a Xoops User Object * - * @param $uname - * @return XoopsUser or false + * @param string $uname + * @return XoopsUser|false */ public function getXoopsUser($uname) { @@ -90,10 +100,10 @@ public function getXoopsUser($uname) /** * Launch the synchronisation process * - * @param $datas - * @param $uname - * @param null $pwd - * @return bool + * @param array $datas + * @param string $uname + * @param string|null $pwd + * @return XoopsUser|false */ public function sync($datas, $uname, $pwd = null) { @@ -101,8 +111,12 @@ public function sync($datas, $uname, $pwd = null) if (!$xoopsUser) { // Xoops User Database not exists if ($this->ldap_provisionning) { $xoopsUser = $this->add($datas, $uname, $pwd); - } else { + } elseif ($this->_auth_instance) { $this->_auth_instance->setErrors(0, sprintf(_AUTH_LDAP_XOOPS_USER_NOTFOUND, $uname)); + } else { + // If no auth instance, we cannot set errors + // This is a fallback for legacy code + trigger_error(sprintf(_AUTH_LDAP_XOOPS_USER_NOTFOUND, $uname), E_USER_WARNING); } } else { // Xoops User Database exists if ($this->ldap_provisionning && $this->ldap_provisionning_upd) { @@ -116,20 +130,20 @@ public function sync($datas, $uname, $pwd = null) /** * Add a new user to the system * - * @param $datas - * @param $uname - * @param null $pwd - * @return bool + * @param array $datas + * @param string $uname + * @param string|null $pwd + * @return XoopsUser|false */ public function add($datas, $uname, $pwd = null) { - $ret = false; + $ret = false; /** @var XoopsMemberHandler $member_handler */ $member_handler = xoops_getHandler('member'); // Create XOOPS Database User $newuser = $member_handler->createUser(); $newuser->setVar('uname', $uname); - $newuser->setVar('pass', password_hash(stripslashes($pwd), PASSWORD_DEFAULT)); + $newuser->setVar('pass', password_hash(stripslashes((string)$pwd), PASSWORD_DEFAULT)); $newuser->setVar('rank', 0); $newuser->setVar('level', 1); $newuser->setVar('timezone_offset', $this->default_TZ); @@ -160,18 +174,18 @@ public function add($datas, $uname, $pwd = null) /** * Modify user information * - * @param $xoopsUser - * @param $datas - * @param $uname - * @param null $pwd - * @return bool + * @param XoopsUser $xoopsUser + * @param array $datas + * @param string $uname + * @param string|null $pwd + * @return XoopsUser|false */ public function change($xoopsUser, $datas, $uname, $pwd = null) { - $ret = false; + $ret = false; /** @var XoopsMemberHandler $member_handler */ $member_handler = xoops_getHandler('member'); - $xoopsUser->setVar('pass', password_hash(stripcslashes($pwd), PASSWORD_DEFAULT)); + $xoopsUser->setVar('pass', password_hash(stripcslashes((string)$pwd), PASSWORD_DEFAULT)); $tab_mapping = explode('|', $this->ldap_field_mapping); foreach ($tab_mapping as $mapping) { $fields = explode('=', trim($mapping)); diff --git a/htdocs/class/auth/auth_xoops.php b/htdocs/class/auth/auth_xoops.php index 80197a806..e95e449aa 100644 --- a/htdocs/class/auth/auth_xoops.php +++ b/htdocs/class/auth/auth_xoops.php @@ -17,7 +17,9 @@ * @author Pierre-Eric MENUET */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * @@ -43,8 +45,8 @@ public function __construct(?XoopsDatabase $dao = null) * Authenticate user * * @param string $uname - * @param string $pwd - * @return bool + * @param string|null $pwd + * @return XoopsUser|bool */ public function authenticate($uname, $pwd = null) { diff --git a/htdocs/class/auth/authfactory.php b/htdocs/class/auth/authfactory.php index 5239c8035..0c513acce 100644 --- a/htdocs/class/auth/authfactory.php +++ b/htdocs/class/auth/authfactory.php @@ -17,7 +17,9 @@ * @author Pierre-Eric MENUET */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * diff --git a/htdocs/class/cache/apc.php b/htdocs/class/cache/apc.php index 8e5dfb629..6afb0dd49 100644 --- a/htdocs/class/cache/apc.php +++ b/htdocs/class/cache/apc.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * APC storage engine for cache. diff --git a/htdocs/class/cache/file.php b/htdocs/class/cache/file.php index cde0a1ae0..261c86722 100644 --- a/htdocs/class/cache/file.php +++ b/htdocs/class/cache/file.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * File Storage engine for cache diff --git a/htdocs/class/cache/memcache.php b/htdocs/class/cache/memcache.php index 252f69a1b..37029e7bb 100644 --- a/htdocs/class/cache/memcache.php +++ b/htdocs/class/cache/memcache.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Memcache storage engine for cache diff --git a/htdocs/class/cache/model.php b/htdocs/class/cache/model.php index 23944edcb..2abc39dd7 100644 --- a/htdocs/class/cache/model.php +++ b/htdocs/class/cache/model.php @@ -26,7 +26,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Database Storage engine for cache diff --git a/htdocs/class/cache/xoopscache.php b/htdocs/class/cache/xoopscache.php index bfe01b420..16cc99ed3 100644 --- a/htdocs/class/cache/xoopscache.php +++ b/htdocs/class/cache/xoopscache.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Caching for CakePHP. diff --git a/htdocs/class/captcha/config.dist.php b/htdocs/class/captcha/config.dist.php index e3e3c5133..3e7e0bd26 100644 --- a/htdocs/class/captcha/config.dist.php +++ b/htdocs/class/captcha/config.dist.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * This keeping config in files has really got to stop. If we can't actually put these into diff --git a/htdocs/class/captcha/config.image.dist.php b/htdocs/class/captcha/config.image.dist.php index 06232a240..d99ded24c 100644 --- a/htdocs/class/captcha/config.image.dist.php +++ b/htdocs/class/captcha/config.image.dist.php @@ -19,7 +19,9 @@ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ 'num_chars' => 6, diff --git a/htdocs/class/captcha/config.recaptcha2.dist.php b/htdocs/class/captcha/config.recaptcha2.dist.php index 821c80bcb..fa59a60a4 100644 --- a/htdocs/class/captcha/config.recaptcha2.dist.php +++ b/htdocs/class/captcha/config.recaptcha2.dist.php @@ -19,7 +19,9 @@ * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @link https://xoops.org */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ 'website_key' => 'YourWebsiteKey', //https://www.google.com/recaptcha/intro/index.html YourWebsiteKey diff --git a/htdocs/class/captcha/config.text.dist.php b/htdocs/class/captcha/config.text.dist.php index 720ac678f..74c551cbd 100644 --- a/htdocs/class/captcha/config.text.dist.php +++ b/htdocs/class/captcha/config.text.dist.php @@ -17,7 +17,9 @@ * @author trabis */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ 'num_chars' => 6, // Maximum characters diff --git a/htdocs/class/captcha/image.php b/htdocs/class/captcha/image.php index b6523be1c..86b5f7b73 100644 --- a/htdocs/class/captcha/image.php +++ b/htdocs/class/captcha/image.php @@ -18,7 +18,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class XoopsCaptchaImage diff --git a/htdocs/class/captcha/recaptcha2.php b/htdocs/class/captcha/recaptcha2.php index aa0b8a0dc..b7151e26a 100644 --- a/htdocs/class/captcha/recaptcha2.php +++ b/htdocs/class/captcha/recaptcha2.php @@ -23,7 +23,9 @@ * @link https://xoops.org */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class XoopsCaptchaRecaptcha2 diff --git a/htdocs/class/captcha/text.php b/htdocs/class/captcha/text.php index 8c3dfb171..bbf9d8043 100644 --- a/htdocs/class/captcha/text.php +++ b/htdocs/class/captcha/text.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class XoopsCaptchaText diff --git a/htdocs/class/captcha/xoopscaptcha.php b/htdocs/class/captcha/xoopscaptcha.php index c2d60f1b6..361b2d0d2 100644 --- a/htdocs/class/captcha/xoopscaptcha.php +++ b/htdocs/class/captcha/xoopscaptcha.php @@ -21,7 +21,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class XoopsCaptcha diff --git a/htdocs/class/commentrenderer.php b/htdocs/class/commentrenderer.php index cadd4f66c..3a1d9b2a0 100644 --- a/htdocs/class/commentrenderer.php +++ b/htdocs/class/commentrenderer.php @@ -17,7 +17,9 @@ * @author Kazumi Ono */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Display comments diff --git a/htdocs/class/criteria.php b/htdocs/class/criteria.php index 9610a5222..242d50882 100644 --- a/htdocs/class/criteria.php +++ b/htdocs/class/criteria.php @@ -18,7 +18,9 @@ * @author Nathan Dial * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A criteria (grammar?) for a database query. diff --git a/htdocs/class/database/database.php b/htdocs/class/database/database.php index 4f22ec140..6fbc7a059 100644 --- a/htdocs/class/database/database.php +++ b/htdocs/class/database/database.php @@ -17,7 +17,9 @@ * @author Kazumi Ono */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * make sure this is only included once! diff --git a/htdocs/class/database/databasefactory.php b/htdocs/class/database/databasefactory.php index a77fbfffe..ae7bdce67 100644 --- a/htdocs/class/database/databasefactory.php +++ b/htdocs/class/database/databasefactory.php @@ -14,7 +14,9 @@ * @package kernel * @subpackage database */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * XoopsDatabaseFactory diff --git a/htdocs/class/database/mysqldatabase.php b/htdocs/class/database/mysqldatabase.php index 154f1a2ad..d7b91ed85 100644 --- a/htdocs/class/database/mysqldatabase.php +++ b/htdocs/class/database/mysqldatabase.php @@ -17,7 +17,9 @@ * @author Kazumi Ono * @author Rodney Fulk */ -defined('XOOPS_ROOT_PATH') || die('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} include_once XOOPS_ROOT_PATH . '/class/database/database.php'; diff --git a/htdocs/class/database/sqlutility.php b/htdocs/class/database/sqlutility.php index 9dd41a96f..b6dd930ae 100644 --- a/htdocs/class/database/sqlutility.php +++ b/htdocs/class/database/sqlutility.php @@ -16,7 +16,9 @@ * @author Kazumi Ono */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * provide some utility methods for databases diff --git a/htdocs/class/downloader.php b/htdocs/class/downloader.php index 69afe137f..0906e2ee7 100644 --- a/htdocs/class/downloader.php +++ b/htdocs/class/downloader.php @@ -16,7 +16,9 @@ * @author Kazumi Ono */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Sends non HTML files through a http socket diff --git a/htdocs/class/errorhandler.php b/htdocs/class/errorhandler.php index e9fedecc2..dec95986c 100644 --- a/htdocs/class/errorhandler.php +++ b/htdocs/class/errorhandler.php @@ -16,7 +16,9 @@ * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_loadLanguage('errors'); diff --git a/htdocs/class/file/file.php b/htdocs/class/file/file.php index 48bddbfc6..b7cd5b04a 100644 --- a/htdocs/class/file/file.php +++ b/htdocs/class/file/file.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Convenience class for reading, writing and appending to files. @@ -382,8 +384,8 @@ public function name() /** * makes filename safe for saving * - * @param string $name the name of the file to make safe if different from $this->name - * @param null|string $ext + * @param string|null $name the name of the file to make safe if different from $this->name + * @param string|null $ext * @return string $ext the extension of the file * @access public */ diff --git a/htdocs/class/file/xoopsfile.php b/htdocs/class/file/xoopsfile.php index 19f0b7b25..e4ce7410e 100644 --- a/htdocs/class/file/xoopsfile.php +++ b/htdocs/class/file/xoopsfile.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * XoopsFile diff --git a/htdocs/class/logger.php b/htdocs/class/logger.php index 255a0c44b..75886ab8e 100644 --- a/htdocs/class/logger.php +++ b/htdocs/class/logger.php @@ -17,7 +17,9 @@ * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * this file is for backward compatibility only diff --git a/htdocs/class/logger/render.php b/htdocs/class/logger/render.php index dd10432bb..04f07143e 100644 --- a/htdocs/class/logger/render.php +++ b/htdocs/class/logger/render.php @@ -19,7 +19,9 @@ * * @todo Not well written, just keep as it is. Refactored in 3.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} $ret = ''; if ($mode === 'popup') { diff --git a/htdocs/class/logger/xoopslogger.php b/htdocs/class/logger/xoopslogger.php index 26adcff80..737131b08 100644 --- a/htdocs/class/logger/xoopslogger.php +++ b/htdocs/class/logger/xoopslogger.php @@ -20,7 +20,9 @@ * * @todo Not well written, just keep as it is. Refactored in 3.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Collects information for a page request @@ -143,9 +145,9 @@ public function stopTime($name = 'XOOPS') * Log a database query * * @param string $sql SQL string - * @param string $error error message (if any) - * @param int $errno error number (if any) - * @param null $query_time + * @param string|null $error error message (if any) + * @param int|null $errno error number (if any) + * @param float|null $query_time */ public function addQuery($sql, $error = null, $errno = null, $query_time = null) { diff --git a/htdocs/class/logger_render.php b/htdocs/class/logger_render.php index e33fbf74a..4f7256803 100644 --- a/htdocs/class/logger_render.php +++ b/htdocs/class/logger_render.php @@ -17,7 +17,9 @@ * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * this file is for backward compatibility only diff --git a/htdocs/class/mail/xoopsmultimailer.php b/htdocs/class/mail/xoopsmultimailer.php index fc4c3ffaa..becefe48a 100644 --- a/htdocs/class/mail/xoopsmultimailer.php +++ b/htdocs/class/mail/xoopsmultimailer.php @@ -25,7 +25,9 @@ * @author Jochen Büînagel */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception as PHPMailerException; diff --git a/htdocs/class/mimetypes.inc.php b/htdocs/class/mimetypes.inc.php index b9d4bfb15..0e04d4bf5 100644 --- a/htdocs/class/mimetypes.inc.php +++ b/htdocs/class/mimetypes.inc.php @@ -15,7 +15,9 @@ * * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} $GLOBALS['xoopsLogger']->addDeprecated("'/class/mimetypes.inc.php' is deprecated, use '/include/mimetypes.inc.php' directly."); diff --git a/htdocs/class/model/joint.php b/htdocs/class/model/joint.php index 2cefca22f..03270bed7 100644 --- a/htdocs/class/model/joint.php +++ b/htdocs/class/model/joint.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Object joint handler class. diff --git a/htdocs/class/model/read.php b/htdocs/class/model/read.php index 58d44733e..fdef27105 100644 --- a/htdocs/class/model/read.php +++ b/htdocs/class/model/read.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Object render handler class. diff --git a/htdocs/class/model/stats.php b/htdocs/class/model/stats.php index 1c037f10c..f02561a8d 100644 --- a/htdocs/class/model/stats.php +++ b/htdocs/class/model/stats.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Object stats handler class. diff --git a/htdocs/class/model/sync.php b/htdocs/class/model/sync.php index 35b0228da..dee968d9a 100644 --- a/htdocs/class/model/sync.php +++ b/htdocs/class/model/sync.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Object synchronization handler class. diff --git a/htdocs/class/model/write.php b/htdocs/class/model/write.php index ef6879d79..d47d0309c 100644 --- a/htdocs/class/model/write.php +++ b/htdocs/class/model/write.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Object write handler class. diff --git a/htdocs/class/model/xoopsmodel.php b/htdocs/class/model/xoopsmodel.php index e638a1ff5..c0fca7927 100644 --- a/htdocs/class/model/xoopsmodel.php +++ b/htdocs/class/model/xoopsmodel.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} include_once XOOPS_ROOT_PATH . '/kernel/object.php'; diff --git a/htdocs/class/module.errorhandler.php b/htdocs/class/module.errorhandler.php index 9ec219ca1..75d546551 100644 --- a/htdocs/class/module.errorhandler.php +++ b/htdocs/class/module.errorhandler.php @@ -17,7 +17,9 @@ * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} $GLOBALS['xoopsLogger']->addDeprecated("'/class/module.errorhandler.php' is deprecated since XOOPS 2.5.4, please create your own error messages instead."); diff --git a/htdocs/class/pagenav.php b/htdocs/class/pagenav.php index adb30c109..aa820fc35 100644 --- a/htdocs/class/pagenav.php +++ b/htdocs/class/pagenav.php @@ -18,7 +18,9 @@ use Xmf\Request; -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class XoopsPageNav diff --git a/htdocs/class/preload.php b/htdocs/class/preload.php index c55cb651b..de4068283 100644 --- a/htdocs/class/preload.php +++ b/htdocs/class/preload.php @@ -22,7 +22,9 @@ * XOOPS preload implemented in XOOPS is different from methods defined in this class, thus module developers are advised to be careful if you use current preload methods */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} XoopsLoad::load('XoopsLists'); XoopsLoad::load('XoopsCache'); diff --git a/htdocs/class/smarty3_plugins/function.xoMemberInfo.php b/htdocs/class/smarty3_plugins/function.xoMemberInfo.php index f6cc2a80b..c5e185b31 100644 --- a/htdocs/class/smarty3_plugins/function.xoMemberInfo.php +++ b/htdocs/class/smarty3_plugins/function.xoMemberInfo.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/class/smarty3_plugins/function.xoUserInfo.php b/htdocs/class/smarty3_plugins/function.xoUserInfo.php index e7cc2b9a0..d09705f25 100644 --- a/htdocs/class/smarty3_plugins/function.xoUserInfo.php +++ b/htdocs/class/smarty3_plugins/function.xoUserInfo.php @@ -10,7 +10,7 @@ */ /** - * @copyright 2000-2020 XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @author XOOPS Development Team */ diff --git a/htdocs/class/smarty3_plugins/function.xoops_link.php b/htdocs/class/smarty3_plugins/function.xoops_link.php index abd112aa9..8ac9ed49d 100644 --- a/htdocs/class/smarty3_plugins/function.xoops_link.php +++ b/htdocs/class/smarty3_plugins/function.xoops_link.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/class/tardownloader.php b/htdocs/class/tardownloader.php index f5ff99108..faaa02aa6 100644 --- a/htdocs/class/tardownloader.php +++ b/htdocs/class/tardownloader.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (http://www.myweb.ne.jp/, http://jp.xoops.org/) */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * base class diff --git a/htdocs/class/template.php b/htdocs/class/template.php index ea6cd4ee3..9b898e61e 100644 --- a/htdocs/class/template.php +++ b/htdocs/class/template.php @@ -18,7 +18,9 @@ * @subpackage core */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_loadLanguage('global'); @@ -87,7 +89,7 @@ public function __construct() * * @param string $tplSource The template to render * @param bool $display If rendered text should be output or returned - * @param null $vars + * @param mixed $vars * * @return string Rendered output if $display was false */ diff --git a/htdocs/class/textsanitizer/censor/censor.php b/htdocs/class/textsanitizer/censor/censor.php index a4206da7d..297e46452 100644 --- a/htdocs/class/textsanitizer/censor/censor.php +++ b/htdocs/class/textsanitizer/censor/censor.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Replaces banned words in a string with their replacements or terminate current request diff --git a/htdocs/class/textsanitizer/censor/config.censor.dist.php b/htdocs/class/textsanitizer/censor/config.censor.dist.php index f8df26ff4..0a73e9969 100644 --- a/htdocs/class/textsanitizer/censor/config.censor.dist.php +++ b/htdocs/class/textsanitizer/censor/config.censor.dist.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ 'censor_terminate' => false, //set to true if you want to trigger an error page diff --git a/htdocs/class/textsanitizer/config.custom.php b/htdocs/class/textsanitizer/config.custom.php index fd74194ab..0c800c546 100644 --- a/htdocs/class/textsanitizer/config.custom.php +++ b/htdocs/class/textsanitizer/config.custom.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ // Filters XSS scripts on display of text diff --git a/htdocs/class/textsanitizer/config.dist.php b/htdocs/class/textsanitizer/config.dist.php index dfea06ba9..4726ee431 100644 --- a/htdocs/class/textsanitizer/config.dist.php +++ b/htdocs/class/textsanitizer/config.dist.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ 'extensions' => [ diff --git a/htdocs/class/textsanitizer/iframe/iframe.php b/htdocs/class/textsanitizer/iframe/iframe.php index d1db821b5..5aa1c7673 100644 --- a/htdocs/class/textsanitizer/iframe/iframe.php +++ b/htdocs/class/textsanitizer/iframe/iframe.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class MytsIframe diff --git a/htdocs/class/textsanitizer/image/config.image.dist.php b/htdocs/class/textsanitizer/image/config.image.dist.php index daf0db04e..4f0cd7384 100644 --- a/htdocs/class/textsanitizer/image/config.image.dist.php +++ b/htdocs/class/textsanitizer/image/config.image.dist.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ // Click to open an image in a new window in full size using CaricaFoto diff --git a/htdocs/class/textsanitizer/image/image.php b/htdocs/class/textsanitizer/image/image.php index b633f0e8e..8c8a39754 100644 --- a/htdocs/class/textsanitizer/image/image.php +++ b/htdocs/class/textsanitizer/image/image.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} global $xoopsConfig; include_once $GLOBALS['xoops']->path('language/' . $xoopsConfig['language'] . '/misc.php'); diff --git a/htdocs/class/textsanitizer/li/li.php b/htdocs/class/textsanitizer/li/li.php index 6912a893c..7141fb9ca 100644 --- a/htdocs/class/textsanitizer/li/li.php +++ b/htdocs/class/textsanitizer/li/li.php @@ -17,7 +17,9 @@ * @author Wishcraft * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class MytsLi diff --git a/htdocs/class/textsanitizer/mms/config.mms.dist.php b/htdocs/class/textsanitizer/mms/config.mms.dist.php index 3ecdcfe8e..594733028 100644 --- a/htdocs/class/textsanitizer/mms/config.mms.dist.php +++ b/htdocs/class/textsanitizer/mms/config.mms.dist.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ 'enable_mms_entry' => true, // false to disable entry button in editor, existing content will still play diff --git a/htdocs/class/textsanitizer/mms/mms.php b/htdocs/class/textsanitizer/mms/mms.php index 29c6452aa..27862b072 100644 --- a/htdocs/class/textsanitizer/mms/mms.php +++ b/htdocs/class/textsanitizer/mms/mms.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang * @deprecated since 2.5.9 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class MytsMms diff --git a/htdocs/class/textsanitizer/mp3/config.mp3.dist.php b/htdocs/class/textsanitizer/mp3/config.mp3.dist.php index f873498c0..3e59fefc9 100644 --- a/htdocs/class/textsanitizer/mp3/config.mp3.dist.php +++ b/htdocs/class/textsanitizer/mp3/config.mp3.dist.php @@ -16,7 +16,9 @@ * @since 2.5.11 * @author mamba */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ 'enable_mp3_entry' => true, // Set to false to disable the MP3 button in the textarea editor diff --git a/htdocs/class/textsanitizer/mp3/mp3.php b/htdocs/class/textsanitizer/mp3/mp3.php index 93ca97b15..96844a7e4 100644 --- a/htdocs/class/textsanitizer/mp3/mp3.php +++ b/htdocs/class/textsanitizer/mp3/mp3.php @@ -17,7 +17,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class MytsMp3 diff --git a/htdocs/class/textsanitizer/rtsp/config.rtsp.dist.php b/htdocs/class/textsanitizer/rtsp/config.rtsp.dist.php index 59a8ba125..49ba0b036 100644 --- a/htdocs/class/textsanitizer/rtsp/config.rtsp.dist.php +++ b/htdocs/class/textsanitizer/rtsp/config.rtsp.dist.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ 'enable_rtsp_entry' => true, // false to disable entry button in editor, existing content will still play diff --git a/htdocs/class/textsanitizer/rtsp/rtsp.php b/htdocs/class/textsanitizer/rtsp/rtsp.php index 4ef119ec6..2871f7f91 100644 --- a/htdocs/class/textsanitizer/rtsp/rtsp.php +++ b/htdocs/class/textsanitizer/rtsp/rtsp.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang * @deprecated since 2.5.9 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class MytsRtsp diff --git a/htdocs/class/textsanitizer/syntaxhighlight/config.syntaxhighlight.dist.php b/htdocs/class/textsanitizer/syntaxhighlight/config.syntaxhighlight.dist.php index 560d7bb79..f88b6f54c 100644 --- a/htdocs/class/textsanitizer/syntaxhighlight/config.syntaxhighlight.dist.php +++ b/htdocs/class/textsanitizer/syntaxhighlight/config.syntaxhighlight.dist.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ 'highlight' => 'php', // Source code highlight: '' - disable; 'php' - php highlight; diff --git a/htdocs/class/textsanitizer/syntaxhighlight/syntaxhighlight.php b/htdocs/class/textsanitizer/syntaxhighlight/syntaxhighlight.php index 689a45b05..125bc14b1 100644 --- a/htdocs/class/textsanitizer/syntaxhighlight/syntaxhighlight.php +++ b/htdocs/class/textsanitizer/syntaxhighlight/syntaxhighlight.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class MytsSyntaxhighlight diff --git a/htdocs/class/textsanitizer/textfilter/config.textfilter.dist.php b/htdocs/class/textsanitizer/textfilter/config.textfilter.dist.php index 973fc7aea..7ed2bbb17 100644 --- a/htdocs/class/textsanitizer/textfilter/config.textfilter.dist.php +++ b/htdocs/class/textsanitizer/textfilter/config.textfilter.dist.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ 'tags' => [], // Tags to be filtered out diff --git a/htdocs/class/textsanitizer/textfilter/textfilter.php b/htdocs/class/textsanitizer/textfilter/textfilter.php index 203697940..8c77f7746 100644 --- a/htdocs/class/textsanitizer/textfilter/textfilter.php +++ b/htdocs/class/textsanitizer/textfilter/textfilter.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Filter out possible malicious text diff --git a/htdocs/class/textsanitizer/ul/ul.php b/htdocs/class/textsanitizer/ul/ul.php index 5025bd6ac..1ee6b4b20 100644 --- a/htdocs/class/textsanitizer/ul/ul.php +++ b/htdocs/class/textsanitizer/ul/ul.php @@ -17,7 +17,9 @@ * @author Wishcraft * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class MytsUl diff --git a/htdocs/class/textsanitizer/wiki/config.wiki.dist.php b/htdocs/class/textsanitizer/wiki/config.wiki.dist.php index ef21f944f..302a1c671 100644 --- a/htdocs/class/textsanitizer/wiki/config.wiki.dist.php +++ b/htdocs/class/textsanitizer/wiki/config.wiki.dist.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ 'link' => XOOPS_URL . '/modules/mediawiki/?title=%s',// The link to wiki module diff --git a/htdocs/class/textsanitizer/wiki/wiki.php b/htdocs/class/textsanitizer/wiki/wiki.php index 0d1ae64dd..d13c56105 100644 --- a/htdocs/class/textsanitizer/wiki/wiki.php +++ b/htdocs/class/textsanitizer/wiki/wiki.php @@ -19,7 +19,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class MytsWiki diff --git a/htdocs/class/textsanitizer/wmp/config.wmp.dist.php b/htdocs/class/textsanitizer/wmp/config.wmp.dist.php index eb01aa5e2..7beb317bb 100644 --- a/htdocs/class/textsanitizer/wmp/config.wmp.dist.php +++ b/htdocs/class/textsanitizer/wmp/config.wmp.dist.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang * @deprecated since 2.5.9 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ 'enable_wmp_entry' => true, // false to disable entry button in editor, existing content will still play diff --git a/htdocs/class/textsanitizer/wmp/wmp.php b/htdocs/class/textsanitizer/wmp/wmp.php index 0888fa8fe..3075d8167 100644 --- a/htdocs/class/textsanitizer/wmp/wmp.php +++ b/htdocs/class/textsanitizer/wmp/wmp.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class MytsWmp diff --git a/htdocs/class/theme.php b/htdocs/class/theme.php index b03937138..3fcdc03d6 100644 --- a/htdocs/class/theme.php +++ b/htdocs/class/theme.php @@ -20,7 +20,9 @@ use Xmf\Request; -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * xos_opal_ThemeFactory diff --git a/htdocs/class/theme_blocks.php b/htdocs/class/theme_blocks.php index fc19812ea..c93163677 100644 --- a/htdocs/class/theme_blocks.php +++ b/htdocs/class/theme_blocks.php @@ -19,7 +19,9 @@ /** * This file cannot be requested directly */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} include_once $GLOBALS['xoops']->path('class/xoopsblock.php'); include_once $GLOBALS['xoops']->path('class/template.php'); diff --git a/htdocs/class/tree.php b/htdocs/class/tree.php index ef339e331..dce739223 100644 --- a/htdocs/class/tree.php +++ b/htdocs/class/tree.php @@ -16,7 +16,9 @@ * @author Kazumi Ono (http://www.myweb.ne.jp/, http://jp.xoops.org/) */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A tree structures with {@link XoopsObject}s as nodes diff --git a/htdocs/class/uploader.php b/htdocs/class/uploader.php index 06ce25256..93fe1c627 100644 --- a/htdocs/class/uploader.php +++ b/htdocs/class/uploader.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} use Xmf\Request; diff --git a/htdocs/class/userutility.php b/htdocs/class/userutility.php index 324da2d1d..f0b3a9c61 100644 --- a/htdocs/class/userutility.php +++ b/htdocs/class/userutility.php @@ -16,7 +16,9 @@ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * XoopsUserUtility diff --git a/htdocs/class/utility/xoopsutility.php b/htdocs/class/utility/xoopsutility.php index d3a41c26b..42e8235a4 100644 --- a/htdocs/class/utility/xoopsutility.php +++ b/htdocs/class/utility/xoopsutility.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * XoopsUtility diff --git a/htdocs/class/xml/rpc/bloggerapi.php b/htdocs/class/xml/rpc/bloggerapi.php index 7506285b6..77a1cb92a 100644 --- a/htdocs/class/xml/rpc/bloggerapi.php +++ b/htdocs/class/xml/rpc/bloggerapi.php @@ -10,14 +10,16 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since * @author XOOPS Development Team, Kazumi Ono (AKA onokazu) */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} require_once XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpcapi.php'; /** diff --git a/htdocs/class/xml/rpc/metaweblogapi.php b/htdocs/class/xml/rpc/metaweblogapi.php index 64cfc3255..ebd1e8a8b 100644 --- a/htdocs/class/xml/rpc/metaweblogapi.php +++ b/htdocs/class/xml/rpc/metaweblogapi.php @@ -10,14 +10,16 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since * @author XOOPS Development Team, Kazumi Ono (AKA onokazu) */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} require_once XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpcapi.php'; /** diff --git a/htdocs/class/xml/rpc/movabletypeapi.php b/htdocs/class/xml/rpc/movabletypeapi.php index e1f27353e..7e3da1105 100644 --- a/htdocs/class/xml/rpc/movabletypeapi.php +++ b/htdocs/class/xml/rpc/movabletypeapi.php @@ -10,14 +10,16 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since * @author XOOPS Development Team, Kazumi Ono (AKA onokazu) */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} require_once XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpcapi.php'; /** diff --git a/htdocs/class/xml/rpc/xmlrpcapi.php b/htdocs/class/xml/rpc/xmlrpcapi.php index 138408b5a..99f1e7327 100644 --- a/htdocs/class/xml/rpc/xmlrpcapi.php +++ b/htdocs/class/xml/rpc/xmlrpcapi.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since @@ -114,8 +114,8 @@ public function _checkAdmin() } /** - * @param null $post_id - * @param null $blog_id + * @param int|null $post_id + * @param int|null $blog_id * * @return array */ diff --git a/htdocs/class/xml/rpc/xmlrpcparser.php b/htdocs/class/xml/rpc/xmlrpcparser.php index 8607644a3..774c71570 100644 --- a/htdocs/class/xml/rpc/xmlrpcparser.php +++ b/htdocs/class/xml/rpc/xmlrpcparser.php @@ -10,14 +10,16 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since * @author XOOPS Development Team, Kazumi Ono (AKA onokazu) */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} require_once XOOPS_ROOT_PATH . '/class/xml/saxparser.php'; require_once XOOPS_ROOT_PATH . '/class/xml/xmltaghandler.php'; diff --git a/htdocs/class/xml/rpc/xmlrpctag.php b/htdocs/class/xml/rpc/xmlrpctag.php index d2ad274be..f938ac38d 100644 --- a/htdocs/class/xml/rpc/xmlrpctag.php +++ b/htdocs/class/xml/rpc/xmlrpctag.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since @@ -146,8 +146,8 @@ class XoopsXmlRpcFault extends XoopsXmlRpcTag public $_extra; /** - * @param $code - * @param null $extra + * @param int $code + * @param string|null $extra */ public function __construct($code, $extra = null) { diff --git a/htdocs/class/xml/rpc/xoopsapi.php b/htdocs/class/xml/rpc/xoopsapi.php index 0973c83f7..758eccfd2 100644 --- a/htdocs/class/xml/rpc/xoopsapi.php +++ b/htdocs/class/xml/rpc/xoopsapi.php @@ -10,14 +10,16 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since * @author XOOPS Development Team, Kazumi Ono (AKA onokazu) */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} require_once XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpcapi.php'; /** diff --git a/htdocs/class/xml/rss/xmlrss2parser.php b/htdocs/class/xml/rss/xmlrss2parser.php index a1381bfa1..070c25066 100644 --- a/htdocs/class/xml/rss/xmlrss2parser.php +++ b/htdocs/class/xml/rss/xmlrss2parser.php @@ -10,14 +10,16 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since * @author XOOPS Development Team, Kazumi Ono (AKA onokazu) */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} require_once(XOOPS_ROOT_PATH . '/class/xml/saxparser.php'); require_once(XOOPS_ROOT_PATH . '/class/xml/xmltaghandler.php'); @@ -77,7 +79,7 @@ public function setChannelData($name, &$value) } /** - * @param null $name + * @param string|null $name * * @return array|bool */ @@ -100,7 +102,7 @@ public function setImageData($name, &$value) } /** - * @param null $name + * @param string|null $name * * @return array|bool */ diff --git a/htdocs/class/xml/themesetparser.php b/htdocs/class/xml/themesetparser.php index 4fe722402..812684613 100644 --- a/htdocs/class/xml/themesetparser.php +++ b/htdocs/class/xml/themesetparser.php @@ -16,7 +16,9 @@ * @since 1.0.0 * @author Author: Kazumi Ono (AKA onokazu) */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} include_once XOOPS_ROOT_PATH . '/class/xml/saxparser.php'; include_once XOOPS_ROOT_PATH . '/class/xml/xmltaghandler.php'; @@ -62,7 +64,7 @@ public function setThemeSetData($name, &$value) } /** - * @param null $name + * @param string|null $name * * @return array|bool */ diff --git a/htdocs/class/xoopsblock.php b/htdocs/class/xoopsblock.php index 0eec15dc5..834d33123 100644 --- a/htdocs/class/xoopsblock.php +++ b/htdocs/class/xoopsblock.php @@ -28,6 +28,8 @@ * previously define. Eventually, that compatibility will be removed, and any * surviving logic will be moved to the handler */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_getHandler('block'); diff --git a/htdocs/class/xoopscomments.php b/htdocs/class/xoopscomments.php index a6d9ebcde..fc0fc26d9 100644 --- a/htdocs/class/xoopscomments.php +++ b/htdocs/class/xoopscomments.php @@ -16,7 +16,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} include_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; require_once XOOPS_ROOT_PATH . '/kernel/object.php'; @@ -59,8 +61,8 @@ class XoopsComments extends XoopsObject public $prefix; /** - * @param $ctable - * @param null|array $id + * @param string|null $ctable + * @param array|int|string|null $id */ public function __construct($ctable, $id = null) { diff --git a/htdocs/class/xoopseditor/dhtmltextarea/dhtmltextarea.php b/htdocs/class/xoopseditor/dhtmltextarea/dhtmltextarea.php index f45c96172..a3e8f534e 100644 --- a/htdocs/class/xoopseditor/dhtmltextarea/dhtmltextarea.php +++ b/htdocs/class/xoopseditor/dhtmltextarea/dhtmltextarea.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsEditor'); diff --git a/htdocs/class/xoopseditor/dhtmltextarea/editor_registry.php b/htdocs/class/xoopseditor/dhtmltextarea/editor_registry.php index 5f876695f..956b1d711 100644 --- a/htdocs/class/xoopseditor/dhtmltextarea/editor_registry.php +++ b/htdocs/class/xoopseditor/dhtmltextarea/editor_registry.php @@ -15,7 +15,9 @@ * @since 2.3.0 * @package xoopseditor */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} return $config = [ 'class' => 'FormDhtmlTextArea', diff --git a/htdocs/class/xoopseditor/sampleform.inc.php b/htdocs/class/xoopseditor/sampleform.inc.php index 832f7a254..d690696f3 100644 --- a/htdocs/class/xoopseditor/sampleform.inc.php +++ b/htdocs/class/xoopseditor/sampleform.inc.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Edit form with selected editor diff --git a/htdocs/class/xoopseditor/tinymce/include/xoopscode.php b/htdocs/class/xoopseditor/tinymce/include/xoopscode.php index 384742cb4..e8d2c2bcf 100644 --- a/htdocs/class/xoopseditor/tinymce/include/xoopscode.php +++ b/htdocs/class/xoopseditor/tinymce/include/xoopscode.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // Add your code here to check access by groups diff --git a/htdocs/class/xoopseditor/tinymce/include/xoopsemotions.php b/htdocs/class/xoopseditor/tinymce/include/xoopsemotions.php index c41929d01..bba1ec4d5 100644 --- a/htdocs/class/xoopseditor/tinymce/include/xoopsemotions.php +++ b/htdocs/class/xoopseditor/tinymce/include/xoopsemotions.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} include_once XOOPS_ROOT_PATH . '/modules/system/constants.php'; // Add your code here to check access by groups diff --git a/htdocs/class/xoopseditor/tinymce/include/xoopsimagemanager.php b/htdocs/class/xoopseditor/tinymce/include/xoopsimagemanager.php index a3b822fdd..5c917ec36 100644 --- a/htdocs/class/xoopseditor/tinymce/include/xoopsimagemanager.php +++ b/htdocs/class/xoopseditor/tinymce/include/xoopsimagemanager.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // check category readability by group $groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : [XOOPS_GROUP_ANONYMOUS]; diff --git a/htdocs/class/xoopseditor/tinymce/include/xoopsmlcontent.php b/htdocs/class/xoopseditor/tinymce/include/xoopsmlcontent.php index 30aae9343..5e9d3e730 100644 --- a/htdocs/class/xoopseditor/tinymce/include/xoopsmlcontent.php +++ b/htdocs/class/xoopseditor/tinymce/include/xoopsmlcontent.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // Xlanguage if ($GLOBALS['module_handler']->getByDirname('xlanguage') && defined('XLANGUAGE_LANG_TAG')) { diff --git a/htdocs/class/xoopseditor/tinymce/include/xoopsquote.php b/htdocs/class/xoopseditor/tinymce/include/xoopsquote.php index e6f90aacf..64d86451f 100644 --- a/htdocs/class/xoopseditor/tinymce/include/xoopsquote.php +++ b/htdocs/class/xoopseditor/tinymce/include/xoopsquote.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // Add your code here to check access by groups diff --git a/htdocs/class/xoopseditor/tinymce/settings.php b/htdocs/class/xoopseditor/tinymce/settings.php index 3d3733c07..a780da71a 100644 --- a/htdocs/class/xoopseditor/tinymce/settings.php +++ b/htdocs/class/xoopseditor/tinymce/settings.php @@ -70,5 +70,6 @@ 'theme_advanced_buttons4' => 'xoopsimagemanager,xoopsemotions,xoopsquote,xoopscode,xoopsmlcontent', // Full XHTML rule set 'valid_elements' => '' . 'a[accesskey|charset|class|coords|dir '100%', // newly added + 'height' => '400px', // newly added ]; diff --git a/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsemotions/xoopsemotions.php b/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsemotions/xoopsemotions.php index 44d63842e..4bf19d6ae 100644 --- a/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsemotions/xoopsemotions.php +++ b/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsemotions/xoopsemotions.php @@ -21,7 +21,9 @@ } $xoops_root_path = substr($current_path, 0, strpos(strtolower($current_path), '/class/xoopseditor/tinymce/')); include_once $xoops_root_path . '/mainfile.php'; -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // load mainfile.php - end // get current filename @@ -88,7 +90,7 @@ } $time = time(); -if (!isset($_SESSION['XoopsEmotions']) && (isset($_SESSION['XoopsEmotions_expire']) && $_SESSION['XoopsEmotions_expire'] < $time)) { +if (!isset($_SESSION['XoopsEmotions']) || (isset($_SESSION['XoopsEmotions_expire']) && $_SESSION['XoopsEmotions_expire'] < $time)) { $_SESSION['XoopsEmotions'] = $myts->getSmileys(); $_SESSION['XoopsEmotions_expire'] = $time + 300; } diff --git a/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsimagemanager/xoopsimagebrowser.php b/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsimagemanager/xoopsimagebrowser.php index d26eacd79..239808d06 100644 --- a/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsimagemanager/xoopsimagebrowser.php +++ b/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsimagemanager/xoopsimagebrowser.php @@ -21,7 +21,9 @@ } $xoops_root_path = substr($current_path, 0, strpos(strtolower($current_path), '/class/xoopseditor/tinymce/')); include_once $xoops_root_path . '/mainfile.php'; -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} /** * This code was moved to the top to avoid overriding variables that do not come from post diff --git a/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsimagemanager/xoopsimagemanager.php b/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsimagemanager/xoopsimagemanager.php index 8545a8bae..9ae374f7b 100644 --- a/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsimagemanager/xoopsimagemanager.php +++ b/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsimagemanager/xoopsimagemanager.php @@ -19,7 +19,9 @@ } $xoops_root_path = substr($current_path, 0, strpos(strtolower($current_path), '/class/xoopseditor/tinymce/')); include_once $xoops_root_path . '/mainfile.php'; -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // include include_once XOOPS_ROOT_PATH . '/modules/system/constants.php'; diff --git a/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsmlcontent/xoopsmlcontent.php b/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsmlcontent/xoopsmlcontent.php index 996d135e9..79a5fcbc4 100644 --- a/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsmlcontent/xoopsmlcontent.php +++ b/htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/plugins/xoopsmlcontent/xoopsmlcontent.php @@ -19,7 +19,9 @@ } $xoops_root_path = substr($current_path, 0, strpos(strtolower($current_path), '/class/xoopseditor/tinymce/')); include_once $xoops_root_path . '/mainfile.php'; -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // load mainfile.php - end function langDropdown() diff --git a/htdocs/class/xoopseditor/tinymce5/formtinymce.php b/htdocs/class/xoopseditor/tinymce5/formtinymce.php index 0369987e6..e37f84e98 100644 --- a/htdocs/class/xoopseditor/tinymce5/formtinymce.php +++ b/htdocs/class/xoopseditor/tinymce5/formtinymce.php @@ -73,8 +73,8 @@ public function renderValidationJS() $eltmsg = empty($eltcaption) ? sprintf(_FORM_ENTER, $eltname) : sprintf(_FORM_ENTER, $eltcaption); $eltmsg = str_replace('"', '\"', stripslashes($eltmsg)); $ret = "\n"; - $ret .= "if ( tinymce.get('{$eltname}').getContent() == \"\" || tinymce.get('{$eltname}').getContent() == null) "; - $ret .= "{ window.alert(\"{$eltmsg}\"); tinymce.get('{$eltname}').focus(); return false; }"; + $ret .= "if ( tinymce.get('{$eltname}').getContent() == \"\" || tinymce.get('{$eltname}').getContent() == null) "; + $ret .= "{ window.alert(\"{$eltmsg}\"); tinymce.get('{$eltname}').focus(); return false; }"; return $ret; } @@ -124,7 +124,7 @@ public function render() */ public function isActive() { - return is_readable(XOOPS_ROOT_PATH . $this->rootPath . '/tinymce.php') - && is_readable(XOOPS_ROOT_PATH . $this->rootPath . '/js/tinymce/tinymce.min.js'); + return is_readable(XOOPS_ROOT_PATH . $this->rootPath . '/tinymce.php') + && is_readable(XOOPS_ROOT_PATH . $this->rootPath . '/js/tinymce/tinymce.min.js'); } } diff --git a/htdocs/class/xoopseditor/tinymce5/include/xoopscode.php b/htdocs/class/xoopseditor/tinymce5/include/xoopscode.php index f63d87564..00e205a3f 100644 --- a/htdocs/class/xoopseditor/tinymce5/include/xoopscode.php +++ b/htdocs/class/xoopseditor/tinymce5/include/xoopscode.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // Add your code here to check access by groups diff --git a/htdocs/class/xoopseditor/tinymce5/include/xoopsemotions.php b/htdocs/class/xoopseditor/tinymce5/include/xoopsemotions.php index d8d08eff3..e058778e4 100644 --- a/htdocs/class/xoopseditor/tinymce5/include/xoopsemotions.php +++ b/htdocs/class/xoopseditor/tinymce5/include/xoopsemotions.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} include_once XOOPS_ROOT_PATH . '/modules/system/constants.php'; // Add your code here to check access by groups diff --git a/htdocs/class/xoopseditor/tinymce5/include/xoopsimagemanager.php b/htdocs/class/xoopseditor/tinymce5/include/xoopsimagemanager.php index 1b83600fd..70882530d 100644 --- a/htdocs/class/xoopseditor/tinymce5/include/xoopsimagemanager.php +++ b/htdocs/class/xoopseditor/tinymce5/include/xoopsimagemanager.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // check categories readability by group $groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : [XOOPS_GROUP_ANONYMOUS]; diff --git a/htdocs/class/xoopseditor/tinymce5/include/xoopsmlcontent.php b/htdocs/class/xoopseditor/tinymce5/include/xoopsmlcontent.php index 4ff2e5c8a..b5d590db5 100644 --- a/htdocs/class/xoopseditor/tinymce5/include/xoopsmlcontent.php +++ b/htdocs/class/xoopseditor/tinymce5/include/xoopsmlcontent.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // Xlanguage if ($GLOBALS['module_handler']->getByDirname('xlanguage') && defined('XLANGUAGE_LANG_TAG')) { diff --git a/htdocs/class/xoopseditor/tinymce5/include/xoopsquote.php b/htdocs/class/xoopseditor/tinymce5/include/xoopsquote.php index 087e7f88e..6919bc00b 100644 --- a/htdocs/class/xoopseditor/tinymce5/include/xoopsquote.php +++ b/htdocs/class/xoopseditor/tinymce5/include/xoopsquote.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // Add your code here to check access by groups diff --git a/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsemoticons/plugin.min.js b/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsemoticons/plugin.min.js index 4ee4d7e35..7e3061ab8 100644 --- a/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsemoticons/plugin.min.js +++ b/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsemoticons/plugin.min.js @@ -4,7 +4,7 @@ * @category XoopsEditor * @package TinyMCE7 * @author ForMuss - * @copyright 2020 XOOPS Project (http://xoops.org) + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @link http://xoops.org */ diff --git a/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsemoticons/xoopsemoticons.php b/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsemoticons/xoopsemoticons.php index 1cc55449a..0fa7195b9 100644 --- a/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsemoticons/xoopsemoticons.php +++ b/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsemoticons/xoopsemoticons.php @@ -24,7 +24,9 @@ } $xoops_root_path = substr($current_path, 0, strpos(strtolower($current_path), '/class/xoopseditor/tinymce5/')); include_once $xoops_root_path . '/mainfile.php'; -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // get current filename $current_file = basename(__FILE__); diff --git a/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsimagemanager/plugin.min.js b/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsimagemanager/plugin.min.js index ef6d3b00b..aa9bceb4d 100644 --- a/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsimagemanager/plugin.min.js +++ b/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsimagemanager/plugin.min.js @@ -4,7 +4,7 @@ * @category XoopsEditor * @package TinyMCE7 * @author ForMuss - * @copyright 2020 XOOPS Project (http://xoops.org) + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @link http://xoops.org */ diff --git a/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsimagemanager/xoopsimagemanager.php b/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsimagemanager/xoopsimagemanager.php index c42f814d3..d11bb8fca 100644 --- a/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsimagemanager/xoopsimagemanager.php +++ b/htdocs/class/xoopseditor/tinymce5/js/tinymce/plugins/xoopsimagemanager/xoopsimagemanager.php @@ -26,7 +26,9 @@ } $xoops_root_path = substr($current_path, 0, strpos(strtolower($current_path), '/class/xoopseditor/tinymce5/')); include_once $xoops_root_path . '/mainfile.php'; -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} /** * This code was moved to the top to avoid overriding variables that do not come from post diff --git a/htdocs/class/xoopseditor/tinymce5/settings.php b/htdocs/class/xoopseditor/tinymce5/settings.php index 5dd0a14de..97a975c3a 100644 --- a/htdocs/class/xoopseditor/tinymce5/settings.php +++ b/htdocs/class/xoopseditor/tinymce5/settings.php @@ -37,6 +37,6 @@ 'relative_urls' => false, 'body_class' => 'tinymce5-body', 'menubar' => true, - 'width' => '100%', // newly added - 'height' => '400px', // newly added + 'width' => '100%', // newly added + 'height' => '400px', // newly added ]; diff --git a/htdocs/class/xoopseditor/tinymce7/include/xoopscode.php b/htdocs/class/xoopseditor/tinymce7/include/xoopscode.php index f63d87564..00e205a3f 100644 --- a/htdocs/class/xoopseditor/tinymce7/include/xoopscode.php +++ b/htdocs/class/xoopseditor/tinymce7/include/xoopscode.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // Add your code here to check access by groups diff --git a/htdocs/class/xoopseditor/tinymce7/include/xoopsemotions.php b/htdocs/class/xoopseditor/tinymce7/include/xoopsemotions.php index d8d08eff3..e058778e4 100644 --- a/htdocs/class/xoopseditor/tinymce7/include/xoopsemotions.php +++ b/htdocs/class/xoopseditor/tinymce7/include/xoopsemotions.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} include_once XOOPS_ROOT_PATH . '/modules/system/constants.php'; // Add your code here to check access by groups diff --git a/htdocs/class/xoopseditor/tinymce7/include/xoopsimagemanager.php b/htdocs/class/xoopseditor/tinymce7/include/xoopsimagemanager.php index 1b83600fd..70882530d 100644 --- a/htdocs/class/xoopseditor/tinymce7/include/xoopsimagemanager.php +++ b/htdocs/class/xoopseditor/tinymce7/include/xoopsimagemanager.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // check categories readability by group $groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : [XOOPS_GROUP_ANONYMOUS]; diff --git a/htdocs/class/xoopseditor/tinymce7/include/xoopsmlcontent.php b/htdocs/class/xoopseditor/tinymce7/include/xoopsmlcontent.php index 4ff2e5c8a..b5d590db5 100644 --- a/htdocs/class/xoopseditor/tinymce7/include/xoopsmlcontent.php +++ b/htdocs/class/xoopseditor/tinymce7/include/xoopsmlcontent.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // Xlanguage if ($GLOBALS['module_handler']->getByDirname('xlanguage') && defined('XLANGUAGE_LANG_TAG')) { diff --git a/htdocs/class/xoopseditor/tinymce7/include/xoopsquote.php b/htdocs/class/xoopseditor/tinymce7/include/xoopsquote.php index 087e7f88e..6919bc00b 100644 --- a/htdocs/class/xoopseditor/tinymce7/include/xoopsquote.php +++ b/htdocs/class/xoopseditor/tinymce7/include/xoopsquote.php @@ -10,7 +10,9 @@ * @author Laurent JEN */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // Add your code here to check access by groups diff --git a/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsemoticons/xoopsemoticons.php b/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsemoticons/xoopsemoticons.php index e91e80c51..2ea37d229 100644 --- a/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsemoticons/xoopsemoticons.php +++ b/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsemoticons/xoopsemoticons.php @@ -24,7 +24,9 @@ } $xoops_root_path = substr($current_path, 0, strpos(strtolower($current_path), '/class/xoopseditor/tinymce7/')); include_once $xoops_root_path . '/mainfile.php'; -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} // get current filename $current_file = basename(__FILE__); diff --git a/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/XoopsFormRendererBootstrap5.php b/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/XoopsFormRendererBootstrap5.php index 106a9fa78..582b97b50 100644 --- a/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/XoopsFormRendererBootstrap5.php +++ b/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/XoopsFormRendererBootstrap5.php @@ -19,585 +19,585 @@ */ class XoopsFormRendererBootstrap5 implements XoopsFormRendererInterface { - /** - * Render support for XoopsFormButton - * - * @param XoopsFormButton $element form element - * - * @return string rendered form element - */ - public function renderFormButton(XoopsFormButton $element) - { - return ''; - } - - /** - * Render support for XoopsFormButtonTray - * - * @param XoopsFormButtonTray $element form element - * - * @return string rendered form element - */ - public function renderFormButtonTray(XoopsFormButtonTray $element) - { - $ret = ''; - if ($element->_showDelete) { - $ret .= ''; - } - $ret .= '' - . '' - . ''; - - return $ret; - } - - /** - * Render support for XoopsFormCheckBox - * - * @param XoopsFormCheckBox $element form element - * - * @return string rendered form element - */ - public function renderFormCheckBox(XoopsFormCheckBox $element) - { - $elementName = $element->getName(); - $elementId = $elementName; - $elementOptions = $element->getOptions(); - if (count($elementOptions) > 1 && substr($elementName, -2, 2) !== '[]') { - $elementName .= '[]'; - $element->setName($elementName); - } - - switch ((int) ($element->columns)) { - case 0: - return $this->renderCheckedInline($element, 'checkbox', $elementId, $elementName); - case 1: - return $this->renderCheckedOneColumn($element, 'checkbox', $elementId, $elementName); - default: - return $this->renderCheckedColumnar($element, 'checkbox', $elementId, $elementName); - } - } - - /** - * Render a inline checkbox or radio element - * - * @param XoopsFormCheckBox|XoopsFormRadio $element element being rendered - * @param string $type 'checkbox' or 'radio' - * @param string $elementId input 'id' attribute of element - * @param string $elementName input 'name' attribute of element - * @return string - */ - protected function renderCheckedInline($element, $type, $elementId, $elementName) - { - $ret = ''; - - $idSuffix = 0; - $elementValue = $element->getValue(); - $elementOptions = $element->getOptions(); - foreach ($elementOptions as $value => $name) { - ++$idSuffix; - - $ret .= '
'; - $ret .= "getExtra() . '>'; - $ret .= ''; - $ret .= '
'; - } - - return $ret; - } - - /** - * Render a single column checkbox or radio element - * - * @param XoopsFormCheckBox|XoopsFormRadio $element element being rendered - * @param string $type 'checkbox' or 'radio' - * @param string $elementId input 'id' attribute of element - * @param string $elementName input 'name' attribute of element - * @return string - */ - protected function renderCheckedOneColumn($element, $type, $elementId, $elementName) - { - $ret = ''; - - $idSuffix = 0; - $elementValue = $element->getValue(); - $elementOptions = $element->getOptions(); - foreach ($elementOptions as $value => $name) { - ++$idSuffix; - $ret .= '
'; - $ret .= ''; - $ret .= '
'; - } - - return $ret; - } - - /** - * Render a multicolumn checkbox or radio element - * - * @param XoopsFormCheckBox|XoopsFormRadio $element element being rendered - * @param string $type 'checkbox' or 'radio' - * @param string $elementId input 'id' attribute of element - * @param string $elementName input 'name' attribute of element - * @return string - */ - protected function renderCheckedColumnar($element, $type, $elementId, $elementName) - { - $ret = ''; - - $idSuffix = 0; - $elementValue = $element->getValue(); - $elementOptions = $element->getOptions(); - foreach ($elementOptions as $value => $name) { - ++$idSuffix; - - $ret .= '
'; - $ret .= "getExtra() . '>'; - $ret .= ''; - $ret .= '
'; - } - - return $ret; - } - - /** - * Render support for XoopsFormColorPicker - * - * @param XoopsFormColorPicker $element form element - * - * @return string rendered form element - */ - public function renderFormColorPicker(XoopsFormColorPicker $element) - { - if (isset($GLOBALS['xoTheme'])) { - $GLOBALS['xoTheme']->addScript('include/spectrum.js'); - $GLOBALS['xoTheme']->addStylesheet('include/spectrum.css'); - } else { - echo ''; - echo ''; - } - return 'getExtra() . '>'; - } - - /** - * Render support for XoopsFormDhtmlTextArea - * - * @param XoopsFormDhtmlTextArea $element form element - * - * @return string rendered form element - */ - public function renderFormDhtmlTextArea(XoopsFormDhtmlTextArea $element) - { - static $js_loaded; - - xoops_loadLanguage('formdhtmltextarea'); - $ret = ''; - // actions - $ret .= $this->renderFormDhtmlTAXoopsCode($element) . "
\n"; - // fonts - $ret .= $this->renderFormDhtmlTATypography($element); - // length checker - - $ret .= "
\n"; - // the textarea box - $ret .= "\n"; - - if (empty($element->skipPreview)) { - if (empty($GLOBALS['xoTheme'])) { - $element->js .= implode('', file(XOOPS_ROOT_PATH . '/class/textsanitizer/image/image.js')); - } else { - $GLOBALS['xoTheme']->addScript( - '/class/textsanitizer/image/image.js', - ['type' => 'text/javascript'], - ); - } - $button = ""; - - $ret .= '
' . "
" - . '
' . ' ' . $button . '' - . "
" . _XOOPS_FORM_PREVIEW_CONTENT - . '
' . '
' . '
'; - } - // Load javascript - if (empty($js_loaded)) { - $javascript = ($element->js ? '' : '') - . ''; - $ret = $javascript . $ret; - $js_loaded = true; - } - - return $ret; - } - - /** - * Render xoopscode buttons for editor, include calling text sanitizer extensions - * - * @param XoopsFormDhtmlTextArea $element form element - * - * @return string rendered buttons for xoopscode assistance - */ - protected function renderFormDhtmlTAXoopsCode(XoopsFormDhtmlTextArea $element) - { - $textarea_id = $element->getName(); - $code = ''; - $code .= "
"; - $code .= ""; - $code .= ""; - $code .= ""; - $code .= ""; - $code .= ""; - - $myts = \MyTextSanitizer::getInstance(); - - $extensions = array_filter($myts->config['extensions']); - foreach (array_keys($extensions) as $key) { - $extension = $myts->loadExtension($key); - @[$encode, $js] = $extension->encode($textarea_id); - if (empty($encode)) { - continue; - } - // TODO - MyTextSanitizer button rendering should go through XoopsFormRenderer - $encode = str_replace('btn-default', 'btn-secondary', $encode); - - $code .= $encode; - if (!empty($js)) { - $element->js .= $js; - } - } - $code .= ""; - $code .= ""; - $code .= "
"; - - $xoopsPreload = XoopsPreload::getInstance(); - $xoopsPreload->triggerEvent('core.class.xoopsform.formdhtmltextarea.codeicon', [&$code]); - - return $code; - } - - /** - * Render typography controls for editor (font, size, color) - * - * @param XoopsFormDhtmlTextArea $element form element - * - * @return string rendered typography controls - */ - protected function renderFormDhtmlTATypography(XoopsFormDhtmlTextArea $element) - { - $textarea_id = $element->getName(); - $hiddentext = $element->_hiddenText; - - $fontarray = !empty($GLOBALS['formtextdhtml_fonts']) ? $GLOBALS['formtextdhtml_fonts'] : [ - 'Arial', - 'Courier', - 'Georgia', - 'Helvetica', - 'Impact', - 'Verdana', - 'Haettenschweiler', - ]; - - $colorArray = [ - 'Black' => '000000', - 'Blue' => '38AAFF', - 'Brown' => '987857', - 'Green' => '79D271', - 'Grey' => '888888', - 'Orange' => 'FFA700', - 'Paper' => 'E0E0E0', - 'Purple' => '363E98', - 'Red' => 'FF211E', - 'White' => 'FEFEFE', - 'Yellow' => 'FFD628', - ]; - - $fontStr = '
'; - - $styleStr = "
"; - $styleStr .= ""; - $styleStr .= ""; - $styleStr .= "'; - $styleStr .= "'; - $styleStr .= "
"; - - $alignStr = "
"; - $alignStr .= ""; - $alignStr .= ""; - $alignStr .= ""; - $alignStr .= "
"; - - $fontStr .= " {$styleStr} {$alignStr} \n"; - - $fontStr .= ""; - $fontStr .= "
"; - - return $fontStr; - } - - /** - * Render support for XoopsFormElementTray - * - * @param XoopsFormElementTray $element form element - * - * @return string rendered form element - */ - public function renderFormElementTray(XoopsFormElementTray $element) - { - $count = 0; - $ret = ''; - foreach ($element->getElements() as $ele) { - if ($count > 0) { - $ret .= $element->getDelimeter(); - } - if ($ele->getCaption() != '') { - $ret .= $ele->getCaption() . ' '; - } - $ret .= $ele->render() . NWLINE; - if (!$ele->isHidden()) { - ++$count; - } - } - $ret .= ''; - return $ret; - } - - /** - * Render support for XoopsFormFile - * - * @param XoopsFormFile $element form element - * - * @return string rendered form element - */ - public function renderFormFile(XoopsFormFile $element) - { - return '' - . 'getExtra() . '>' - . ''; - } - - /** - * Render support for XoopsFormLabel - * - * @param XoopsFormLabel $element form element - * - * @return string rendered form element - */ - public function renderFormLabel(XoopsFormLabel $element) - { - return '
' . $element->getValue() . '
'; - } - - /** - * Render support for XoopsFormPassword - * - * @param XoopsFormPassword $element form element - * - * @return string rendered form element - */ - public function renderFormPassword(XoopsFormPassword $element) - { - return 'getExtra() . ' ' . ($element->autoComplete ? '' : 'autocomplete="off" ') . '/>'; - } - - /** - * Render support for XoopsFormRadio - * - * @param XoopsFormRadio $element form element - * - * @return string rendered form element - */ - public function renderFormRadio(XoopsFormRadio $element) - { - $elementName = $element->getName(); - $elementId = $elementName; - - switch ((int) ($element->columns)) { - case 0: - return $this->renderCheckedInline($element, 'radio', $elementId, $elementName); - case 1: - return $this->renderCheckedOneColumn($element, 'radio', $elementId, $elementName); - default: - return $this->renderCheckedColumnar($element, 'radio', $elementId, $elementName); - } - } - - /** - * Render support for XoopsFormSelect - * - * @param XoopsFormSelect $element form element - * - * @return string rendered form element - */ - public function renderFormSelect(XoopsFormSelect $element) - { - $ele_name = $element->getName(); - $ele_title = $element->getTitle(); - $ele_value = $element->getValue(); - $ele_options = $element->getOptions(); - $ret = ''; - - return $ret; - } - - /** - * Render support for XoopsFormText - * - * @param XoopsFormText $element form element - * - * @return string rendered form element - */ - public function renderFormText(XoopsFormText $element) - { - return "getExtra() . '>'; - } - - /** - * Render support for XoopsFormTextArea - * - * @param XoopsFormTextArea $element form element - * - * @return string rendered form element - */ - public function renderFormTextArea(XoopsFormTextArea $element) - { - return "'; - } - - /** - * Render support for XoopsFormTextDateSelect - * - * @param XoopsFormTextDateSelect $element form element - * - * @return string rendered form element - */ - public function renderFormTextDateSelect(XoopsFormTextDateSelect $element) - { - static $included = false; - if (file_exists(XOOPS_ROOT_PATH . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/calendar.php')) { - include_once XOOPS_ROOT_PATH . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/calendar.php'; - } else { - include_once XOOPS_ROOT_PATH . '/language/english/calendar.php'; - } - - $ele_name = $element->getName(); - $ele_value = $element->getValue(false); - if (is_string($ele_value)) { - $display_value = $ele_value; - $ele_value = time(); - } else { - $display_value = date(_SHORTDATESTRING, $ele_value); - } - - $jstime = formatTimestamp($ele_value, 'm/d/Y'); - if (isset($GLOBALS['xoTheme']) && is_object($GLOBALS['xoTheme'])) { - $GLOBALS['xoTheme']->addScript('include/calendar.js'); - $GLOBALS['xoTheme']->addStylesheet('include/calendar-blue.css'); - if (!$included) { - $included = true; - $GLOBALS['xoTheme']->addScript('', '', ' + /** + * Render support for XoopsFormButton + * + * @param XoopsFormButton $element form element + * + * @return string rendered form element + */ + public function renderFormButton(XoopsFormButton $element) + { + return ''; + } + + /** + * Render support for XoopsFormButtonTray + * + * @param XoopsFormButtonTray $element form element + * + * @return string rendered form element + */ + public function renderFormButtonTray(XoopsFormButtonTray $element) + { + $ret = ''; + if ($element->_showDelete) { + $ret .= ''; + } + $ret .= '' + . '' + . ''; + + return $ret; + } + + /** + * Render support for XoopsFormCheckBox + * + * @param XoopsFormCheckBox $element form element + * + * @return string rendered form element + */ + public function renderFormCheckBox(XoopsFormCheckBox $element) + { + $elementName = $element->getName(); + $elementId = $elementName; + $elementOptions = $element->getOptions(); + if (count($elementOptions) > 1 && substr($elementName, -2, 2) !== '[]') { + $elementName .= '[]'; + $element->setName($elementName); + } + + switch ((int) ($element->columns)) { + case 0: + return $this->renderCheckedInline($element, 'checkbox', $elementId, $elementName); + case 1: + return $this->renderCheckedOneColumn($element, 'checkbox', $elementId, $elementName); + default: + return $this->renderCheckedColumnar($element, 'checkbox', $elementId, $elementName); + } + } + + /** + * Render a inline checkbox or radio element + * + * @param XoopsFormCheckBox|XoopsFormRadio $element element being rendered + * @param string $type 'checkbox' or 'radio' + * @param string $elementId input 'id' attribute of element + * @param string $elementName input 'name' attribute of element + * @return string + */ + protected function renderCheckedInline($element, $type, $elementId, $elementName) + { + $ret = ''; + + $idSuffix = 0; + $elementValue = $element->getValue(); + $elementOptions = $element->getOptions(); + foreach ($elementOptions as $value => $name) { + ++$idSuffix; + + $ret .= '
'; + $ret .= "getExtra() . '>'; + $ret .= ''; + $ret .= '
'; + } + + return $ret; + } + + /** + * Render a single column checkbox or radio element + * + * @param XoopsFormCheckBox|XoopsFormRadio $element element being rendered + * @param string $type 'checkbox' or 'radio' + * @param string $elementId input 'id' attribute of element + * @param string $elementName input 'name' attribute of element + * @return string + */ + protected function renderCheckedOneColumn($element, $type, $elementId, $elementName) + { + $ret = ''; + + $idSuffix = 0; + $elementValue = $element->getValue(); + $elementOptions = $element->getOptions(); + foreach ($elementOptions as $value => $name) { + ++$idSuffix; + $ret .= '
'; + $ret .= ''; + $ret .= '
'; + } + + return $ret; + } + + /** + * Render a multicolumn checkbox or radio element + * + * @param XoopsFormCheckBox|XoopsFormRadio $element element being rendered + * @param string $type 'checkbox' or 'radio' + * @param string $elementId input 'id' attribute of element + * @param string $elementName input 'name' attribute of element + * @return string + */ + protected function renderCheckedColumnar($element, $type, $elementId, $elementName) + { + $ret = ''; + + $idSuffix = 0; + $elementValue = $element->getValue(); + $elementOptions = $element->getOptions(); + foreach ($elementOptions as $value => $name) { + ++$idSuffix; + + $ret .= '
'; + $ret .= "getExtra() . '>'; + $ret .= ''; + $ret .= '
'; + } + + return $ret; + } + + /** + * Render support for XoopsFormColorPicker + * + * @param XoopsFormColorPicker $element form element + * + * @return string rendered form element + */ + public function renderFormColorPicker(XoopsFormColorPicker $element) + { + if (isset($GLOBALS['xoTheme'])) { + $GLOBALS['xoTheme']->addScript('include/spectrum.js'); + $GLOBALS['xoTheme']->addStylesheet('include/spectrum.css'); + } else { + echo ''; + echo ''; + } + return 'getExtra() . '>'; + } + + /** + * Render support for XoopsFormDhtmlTextArea + * + * @param XoopsFormDhtmlTextArea $element form element + * + * @return string rendered form element + */ + public function renderFormDhtmlTextArea(XoopsFormDhtmlTextArea $element) + { + static $js_loaded; + + xoops_loadLanguage('formdhtmltextarea'); + $ret = ''; + // actions + $ret .= $this->renderFormDhtmlTAXoopsCode($element) . "
\n"; + // fonts + $ret .= $this->renderFormDhtmlTATypography($element); + // length checker + + $ret .= "
\n"; + // the textarea box + $ret .= "\n"; + + if (empty($element->skipPreview)) { + if (empty($GLOBALS['xoTheme'])) { + $element->js .= implode('', file(XOOPS_ROOT_PATH . '/class/textsanitizer/image/image.js')); + } else { + $GLOBALS['xoTheme']->addScript( + '/class/textsanitizer/image/image.js', + ['type' => 'text/javascript'], + ); + } + $button = ""; + + $ret .= '
' . "
" + . '
' . ' ' . $button . '' + . "
" . _XOOPS_FORM_PREVIEW_CONTENT + . '
' . '
' . '
'; + } + // Load javascript + if (empty($js_loaded)) { + $javascript = ($element->js ? '' : '') + . ''; + $ret = $javascript . $ret; + $js_loaded = true; + } + + return $ret; + } + + /** + * Render xoopscode buttons for editor, include calling text sanitizer extensions + * + * @param XoopsFormDhtmlTextArea $element form element + * + * @return string rendered buttons for xoopscode assistance + */ + protected function renderFormDhtmlTAXoopsCode(XoopsFormDhtmlTextArea $element) + { + $textarea_id = $element->getName(); + $code = ''; + $code .= "
"; + $code .= ""; + $code .= ""; + $code .= ""; + $code .= ""; + $code .= ""; + + $myts = \MyTextSanitizer::getInstance(); + + $extensions = array_filter($myts->config['extensions']); + foreach (array_keys($extensions) as $key) { + $extension = $myts->loadExtension($key); + @[$encode, $js] = $extension->encode($textarea_id); + if (empty($encode)) { + continue; + } + // TODO - MyTextSanitizer button rendering should go through XoopsFormRenderer + $encode = str_replace('btn-default', 'btn-secondary', $encode); + + $code .= $encode; + if (!empty($js)) { + $element->js .= $js; + } + } + $code .= ""; + $code .= ""; + $code .= "
"; + + $xoopsPreload = XoopsPreload::getInstance(); + $xoopsPreload->triggerEvent('core.class.xoopsform.formdhtmltextarea.codeicon', [&$code]); + + return $code; + } + + /** + * Render typography controls for editor (font, size, color) + * + * @param XoopsFormDhtmlTextArea $element form element + * + * @return string rendered typography controls + */ + protected function renderFormDhtmlTATypography(XoopsFormDhtmlTextArea $element) + { + $textarea_id = $element->getName(); + $hiddentext = $element->_hiddenText; + + $fontarray = !empty($GLOBALS['formtextdhtml_fonts']) ? $GLOBALS['formtextdhtml_fonts'] : [ + 'Arial', + 'Courier', + 'Georgia', + 'Helvetica', + 'Impact', + 'Verdana', + 'Haettenschweiler', + ]; + + $colorArray = [ + 'Black' => '000000', + 'Blue' => '38AAFF', + 'Brown' => '987857', + 'Green' => '79D271', + 'Grey' => '888888', + 'Orange' => 'FFA700', + 'Paper' => 'E0E0E0', + 'Purple' => '363E98', + 'Red' => 'FF211E', + 'White' => 'FEFEFE', + 'Yellow' => 'FFD628', + ]; + + $fontStr = '
'; + + $styleStr = "
"; + $styleStr .= ""; + $styleStr .= ""; + $styleStr .= "'; + $styleStr .= "'; + $styleStr .= "
"; + + $alignStr = "
"; + $alignStr .= ""; + $alignStr .= ""; + $alignStr .= ""; + $alignStr .= "
"; + + $fontStr .= " {$styleStr} {$alignStr} \n"; + + $fontStr .= ""; + $fontStr .= "
"; + + return $fontStr; + } + + /** + * Render support for XoopsFormElementTray + * + * @param XoopsFormElementTray $element form element + * + * @return string rendered form element + */ + public function renderFormElementTray(XoopsFormElementTray $element) + { + $count = 0; + $ret = ''; + foreach ($element->getElements() as $ele) { + if ($count > 0) { + $ret .= $element->getDelimeter(); + } + if ($ele->getCaption() != '') { + $ret .= $ele->getCaption() . ' '; + } + $ret .= $ele->render() . NWLINE; + if (!$ele->isHidden()) { + ++$count; + } + } + $ret .= ''; + return $ret; + } + + /** + * Render support for XoopsFormFile + * + * @param XoopsFormFile $element form element + * + * @return string rendered form element + */ + public function renderFormFile(XoopsFormFile $element) + { + return '' + . 'getExtra() . '>' + . ''; + } + + /** + * Render support for XoopsFormLabel + * + * @param XoopsFormLabel $element form element + * + * @return string rendered form element + */ + public function renderFormLabel(XoopsFormLabel $element) + { + return '
' . $element->getValue() . '
'; + } + + /** + * Render support for XoopsFormPassword + * + * @param XoopsFormPassword $element form element + * + * @return string rendered form element + */ + public function renderFormPassword(XoopsFormPassword $element) + { + return 'getExtra() . ' ' . ($element->autoComplete ? '' : 'autocomplete="off" ') . '/>'; + } + + /** + * Render support for XoopsFormRadio + * + * @param XoopsFormRadio $element form element + * + * @return string rendered form element + */ + public function renderFormRadio(XoopsFormRadio $element) + { + $elementName = $element->getName(); + $elementId = $elementName; + + switch ((int) ($element->columns)) { + case 0: + return $this->renderCheckedInline($element, 'radio', $elementId, $elementName); + case 1: + return $this->renderCheckedOneColumn($element, 'radio', $elementId, $elementName); + default: + return $this->renderCheckedColumnar($element, 'radio', $elementId, $elementName); + } + } + + /** + * Render support for XoopsFormSelect + * + * @param XoopsFormSelect $element form element + * + * @return string rendered form element + */ + public function renderFormSelect(XoopsFormSelect $element) + { + $ele_name = $element->getName(); + $ele_title = $element->getTitle(); + $ele_value = $element->getValue(); + $ele_options = $element->getOptions(); + $ret = ''; + + return $ret; + } + + /** + * Render support for XoopsFormText + * + * @param XoopsFormText $element form element + * + * @return string rendered form element + */ + public function renderFormText(XoopsFormText $element) + { + return "getExtra() . '>'; + } + + /** + * Render support for XoopsFormTextArea + * + * @param XoopsFormTextArea $element form element + * + * @return string rendered form element + */ + public function renderFormTextArea(XoopsFormTextArea $element) + { + return "'; + } + + /** + * Render support for XoopsFormTextDateSelect + * + * @param XoopsFormTextDateSelect $element form element + * + * @return string rendered form element + */ + public function renderFormTextDateSelect(XoopsFormTextDateSelect $element) + { + static $included = false; + if (file_exists(XOOPS_ROOT_PATH . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/calendar.php')) { + include_once XOOPS_ROOT_PATH . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/calendar.php'; + } else { + include_once XOOPS_ROOT_PATH . '/language/english/calendar.php'; + } + + $ele_name = $element->getName(); + $ele_value = $element->getValue(false); + if (is_string($ele_value)) { + $display_value = $ele_value; + $ele_value = time(); + } else { + $display_value = date(_SHORTDATESTRING, $ele_value); + } + + $jstime = formatTimestamp($ele_value, 'm/d/Y'); + if (isset($GLOBALS['xoTheme']) && is_object($GLOBALS['xoTheme'])) { + $GLOBALS['xoTheme']->addScript('include/calendar.js'); + $GLOBALS['xoTheme']->addStylesheet('include/calendar-blue.css'); + if (!$included) { + $included = true; + $GLOBALS['xoTheme']->addScript('', '', ' var calendar = null; function selected(cal, date) @@ -683,86 +683,86 @@ function showCalendar(id) Calendar._TT["WK"] = ""; '); - } - } - return '
' - . 'getExtra() . '>' - . '' - . '' - . '
'; - } - - /** - * Render support for XoopsThemeForm - * - * @param XoopsThemeForm $form form to render - * - * @return string rendered form - */ - public function renderThemeForm(XoopsThemeForm $form) - { - $ele_name = $form->getName(); - - $ret = '
'; - $ret .= '
getExtra() . '>' - . '

' . $form->getTitle() . '

'; - $hidden = ''; - - foreach ($form->getElements() as $element) { - if (!is_object($element)) { // see $form->addBreak() - $ret .= $element; - continue; - } - if ($element->isHidden()) { - $hidden .= $element->render(); - continue; - } - - $ret .= '
'; - if (($caption = $element->getCaption()) != '') { - $ret .= ''; - } else { - $ret .= '
'; - } - $ret .= '
'; - $ret .= $element->render(); - if (($desc = $element->getDescription()) != '') { - $ret .= '

' . $desc . '

'; - } - $ret .= '
'; - $ret .= '
'; - } - $ret .= $hidden; - if ($form->getRequired()) { - $ret .= '
* = Required
'; - } - $ret .= '
'; - $ret .= $form->renderValidationJS(true); - - return $ret; - } - - /** - * Support for themed addBreak - * - * @param XoopsThemeForm $form - * @param string $extra pre-rendered content for break row - * @param string $class class for row - * - * @return void - */ - public function addThemeFormBreak(XoopsThemeForm $form, $extra, $class) - { - $class = ($class != '') ? preg_replace('/[^A-Za-z0-9\s\s_-]/i', '', $class) : ''; - $form->addElement('
' . $extra . '
'); - } + } + } + return '
' + . 'getExtra() . '>' + . '' + . '' + . '
'; + } + + /** + * Render support for XoopsThemeForm + * + * @param XoopsThemeForm $form form to render + * + * @return string rendered form + */ + public function renderThemeForm(XoopsThemeForm $form) + { + $ele_name = $form->getName(); + + $ret = '
'; + $ret .= '
getExtra() . '>' + . '

' . $form->getTitle() . '

'; + $hidden = ''; + + foreach ($form->getElements() as $element) { + if (!is_object($element)) { // see $form->addBreak() + $ret .= $element; + continue; + } + if ($element->isHidden()) { + $hidden .= $element->render(); + continue; + } + + $ret .= '
'; + if (($caption = $element->getCaption()) != '') { + $ret .= ''; + } else { + $ret .= '
'; + } + $ret .= '
'; + $ret .= $element->render(); + if (($desc = $element->getDescription()) != '') { + $ret .= '

' . $desc . '

'; + } + $ret .= '
'; + $ret .= '
'; + } + $ret .= $hidden; + if ($form->getRequired()) { + $ret .= '
* = Required
'; + } + $ret .= '
'; + $ret .= $form->renderValidationJS(true); + + return $ret; + } + + /** + * Support for themed addBreak + * + * @param XoopsThemeForm $form + * @param string $extra pre-rendered content for break row + * @param string $class class for row + * + * @return void + */ + public function addThemeFormBreak(XoopsThemeForm $form, $extra, $class) + { + $class = ($class != '') ? preg_replace('/[^A-Za-z0-9\s\s_-]/i', '', $class) : ''; + $form->addElement('
' . $extra . '
'); + } } diff --git a/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/plugin.js b/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/plugin.js index b31f78b2b..cd99baf07 100644 --- a/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/plugin.js +++ b/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/plugin.js @@ -4,7 +4,7 @@ * @category XoopsEditor * @package TinyMCE7 * @author ForMuss - * @copyright 2025 XOOPS Project (http://xoops.org) + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @link http://xoops.org */ diff --git a/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/plugin.min.js b/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/plugin.min.js index a95e99edf..376576285 100644 --- a/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/plugin.min.js +++ b/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/plugin.min.js @@ -4,7 +4,7 @@ * @category XoopsEditor * @package TinyMCE7 * @author ForMuss - * @copyright 2025 XOOPS Project (http://xoops.org) + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @link http://xoops.org */ diff --git a/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/xoopsimagemanager.php b/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/xoopsimagemanager.php index e2d56d731..554f56201 100644 --- a/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/xoopsimagemanager.php +++ b/htdocs/class/xoopseditor/tinymce7/js/tinymce/plugins/xoopsimagemanager/xoopsimagemanager.php @@ -26,7 +26,9 @@ } $xoops_root_path = substr($current_path, 0, strpos(strtolower($current_path), '/class/xoopseditor/tinymce7/')); include_once $xoops_root_path . '/mainfile.php'; -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} /** * This code was moved to the top to avoid overriding variables that do not come from post @@ -62,8 +64,8 @@ //xoops_load("xoopsmodule"); include_once XOOPS_ROOT_PATH . '/include/cp_functions.php'; include_once XOOPS_ROOT_PATH . '/modules/system/constants.php'; -include_once __DIR__ . '/XoopsFormRendererBootstrap4.php'; -XoopsFormRenderer::getInstance()->set(new XoopsFormRendererBootstrap4()); +include_once __DIR__ . '/XoopsFormRendererBootstrap5.php'; +XoopsFormRenderer::getInstance()->set(new XoopsFormRendererBootstrap5()); global $xoopsConfig; @@ -92,6 +94,9 @@ if (!$GLOBALS['xoopsSecurity']->check()) { redirect_header($current_file . '?target=' . $target, 3, implode('
', $GLOBALS['xoopsSecurity']->getErrors())); } + + + $imgcat_id = Request::getInt('imgcat_id', 0, 'POST'); $imgcat = $imgcat_handler->get($imgcat_id); if (!is_object($imgcat)) { redirect_header($current_file . '?target=' . $target, 3); diff --git a/htdocs/class/xoopseditor/tinymce7/style.css b/htdocs/class/xoopseditor/tinymce7/style.css index d59c4b368..ee2c68a5a 100644 --- a/htdocs/class/xoopseditor/tinymce7/style.css +++ b/htdocs/class/xoopseditor/tinymce7/style.css @@ -4,3 +4,54 @@ body.mceContentBody { background: #fff none; color: #000; } + + +figure.image { + display: inline-block; + border: 1px solid gray; + margin: 0 2px 0 1px; + background: #f5f2f0; +} + +figure.align-left { + float: left; +} + +figure.align-right { + float: right; +} + +figure.image img { + margin: 8px 8px 0 8px; +} + +figure.image figcaption { + margin: 6px 8px 6px 8px; + text-align: center; +} + +/* + Alignment using classes rather than inline styles + check out the "formats" option +*/ + +img.align-left { + float: left; +} + +img.align-right { + float: right; +} + +/* Basic styles for Table of Contents plugin (tableofcontents) */ +.mce-toc { + border: 1px solid gray; +} + +.mce-toc h2 { + margin: 4px; +} + +.mce-toc li { + list-style-type: none; +} diff --git a/htdocs/class/xoopseditor/xoopseditor.inc.php b/htdocs/class/xoopseditor/xoopseditor.inc.php index 89b7adc16..33b5eca89 100644 --- a/htdocs/class/xoopseditor/xoopseditor.inc.php +++ b/htdocs/class/xoopseditor/xoopseditor.inc.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} if (!function_exists('xoopseditor_get_rootpath')) { /** diff --git a/htdocs/class/xoopseditor/xoopseditor.php b/htdocs/class/xoopseditor/xoopseditor.php index cc134cd76..c55f38677 100644 --- a/htdocs/class/xoopseditor/xoopseditor.php +++ b/htdocs/class/xoopseditor/xoopseditor.php @@ -15,7 +15,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsFormTextArea'); diff --git a/htdocs/class/xoopsform/form.php b/htdocs/class/xoopsform/form.php index 810d903ad..bbcb32dd5 100644 --- a/htdocs/class/xoopsform/form.php +++ b/htdocs/class/xoopsform/form.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Abstract base class for forms diff --git a/htdocs/class/xoopsform/formbutton.php b/htdocs/class/xoopsform/formbutton.php index f37cfc70d..6e1dd3af3 100644 --- a/htdocs/class/xoopsform/formbutton.php +++ b/htdocs/class/xoopsform/formbutton.php @@ -16,7 +16,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} xoops_load('XoopsFormElement'); diff --git a/htdocs/class/xoopsform/formbuttontray.php b/htdocs/class/xoopsform/formbuttontray.php index 1345f6c4d..b47967a96 100644 --- a/htdocs/class/xoopsform/formbuttontray.php +++ b/htdocs/class/xoopsform/formbuttontray.php @@ -10,7 +10,9 @@ * @author John Neill * */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * XoopsFormButtonTray diff --git a/htdocs/class/xoopsform/formcaptcha.php b/htdocs/class/xoopsform/formcaptcha.php index caa0091fc..d0ddb1e9d 100644 --- a/htdocs/class/xoopsform/formcaptcha.php +++ b/htdocs/class/xoopsform/formcaptcha.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsFormElement'); diff --git a/htdocs/class/xoopsform/formcheckbox.php b/htdocs/class/xoopsform/formcheckbox.php index 6b677573b..34d1372a5 100644 --- a/htdocs/class/xoopsform/formcheckbox.php +++ b/htdocs/class/xoopsform/formcheckbox.php @@ -17,7 +17,9 @@ * @author Skalpa Keo * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsFormElement'); diff --git a/htdocs/class/xoopsform/formcolorpicker.php b/htdocs/class/xoopsform/formcolorpicker.php index 0fc049a97..11f417ea7 100644 --- a/htdocs/class/xoopsform/formcolorpicker.php +++ b/htdocs/class/xoopsform/formcolorpicker.php @@ -16,7 +16,9 @@ * @since 2.0.0 * @author Zoullou */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Color Selection Field diff --git a/htdocs/class/xoopsform/formdatetime.php b/htdocs/class/xoopsform/formdatetime.php index d08c94d15..a07e22afe 100644 --- a/htdocs/class/xoopsform/formdatetime.php +++ b/htdocs/class/xoopsform/formdatetime.php @@ -16,7 +16,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Date and time selection field diff --git a/htdocs/class/xoopsform/formdhtmltextarea.php b/htdocs/class/xoopsform/formdhtmltextarea.php index fe7dc259a..24ccf60c8 100644 --- a/htdocs/class/xoopsform/formdhtmltextarea.php +++ b/htdocs/class/xoopsform/formdhtmltextarea.php @@ -18,7 +18,9 @@ * @author Taiwen Jiang * @author Vinod */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * base class diff --git a/htdocs/class/xoopsform/formeditor.php b/htdocs/class/xoopsform/formeditor.php index c3a23520c..3c3facb13 100644 --- a/htdocs/class/xoopsform/formeditor.php +++ b/htdocs/class/xoopsform/formeditor.php @@ -16,7 +16,9 @@ * @since 2.0.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsFormTextArea'); diff --git a/htdocs/class/xoopsform/formelement.php b/htdocs/class/xoopsform/formelement.php index e304dc08e..7496225fd 100644 --- a/htdocs/class/xoopsform/formelement.php +++ b/htdocs/class/xoopsform/formelement.php @@ -16,7 +16,9 @@ * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Abstract base class for form elements diff --git a/htdocs/class/xoopsform/formelementtray.php b/htdocs/class/xoopsform/formelementtray.php index 17d6b0789..3ca6a380f 100644 --- a/htdocs/class/xoopsform/formelementtray.php +++ b/htdocs/class/xoopsform/formelementtray.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A group of form elements diff --git a/htdocs/class/xoopsform/formfile.php b/htdocs/class/xoopsform/formfile.php index f1a8d752c..027340681 100644 --- a/htdocs/class/xoopsform/formfile.php +++ b/htdocs/class/xoopsform/formfile.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A file upload field diff --git a/htdocs/class/xoopsform/formhidden.php b/htdocs/class/xoopsform/formhidden.php index c921e2794..3bb5add4e 100644 --- a/htdocs/class/xoopsform/formhidden.php +++ b/htdocs/class/xoopsform/formhidden.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A hidden field diff --git a/htdocs/class/xoopsform/formhiddentoken.php b/htdocs/class/xoopsform/formhiddentoken.php index f4a63ae7b..963df3559 100644 --- a/htdocs/class/xoopsform/formhiddentoken.php +++ b/htdocs/class/xoopsform/formhiddentoken.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A hidden token field diff --git a/htdocs/class/xoopsform/formlabel.php b/htdocs/class/xoopsform/formlabel.php index ecb343810..6dac25d51 100644 --- a/htdocs/class/xoopsform/formlabel.php +++ b/htdocs/class/xoopsform/formlabel.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A text label diff --git a/htdocs/class/xoopsform/formpassword.php b/htdocs/class/xoopsform/formpassword.php index 3ecb30fbd..4738e8531 100644 --- a/htdocs/class/xoopsform/formpassword.php +++ b/htdocs/class/xoopsform/formpassword.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Password Field diff --git a/htdocs/class/xoopsform/formradioyn.php b/htdocs/class/xoopsform/formradioyn.php index 3a67f3315..c799fbd71 100644 --- a/htdocs/class/xoopsform/formradioyn.php +++ b/htdocs/class/xoopsform/formradioyn.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsFormRadio'); diff --git a/htdocs/class/xoopsform/formselect.php b/htdocs/class/xoopsform/formselect.php index a5a6ffa88..07d1604ca 100644 --- a/htdocs/class/xoopsform/formselect.php +++ b/htdocs/class/xoopsform/formselect.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsFormElement'); diff --git a/htdocs/class/xoopsform/formselectcheckgroup.php b/htdocs/class/xoopsform/formselectcheckgroup.php index 0f74afba0..f48188a70 100644 --- a/htdocs/class/xoopsform/formselectcheckgroup.php +++ b/htdocs/class/xoopsform/formselectcheckgroup.php @@ -20,7 +20,9 @@ * @since 2.3.0 * @author John Neill */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsFormCheckBox'); diff --git a/htdocs/class/xoopsform/formselectcountry.php b/htdocs/class/xoopsform/formselectcountry.php index 66d74eb5e..80f6c642c 100644 --- a/htdocs/class/xoopsform/formselectcountry.php +++ b/htdocs/class/xoopsform/formselectcountry.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsLists'); xoops_load('XoopsFormSelect'); diff --git a/htdocs/class/xoopsform/formselecteditor.php b/htdocs/class/xoopsform/formselecteditor.php index 0a6260b97..6754f18fe 100644 --- a/htdocs/class/xoopsform/formselecteditor.php +++ b/htdocs/class/xoopsform/formselecteditor.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsFormElementTray'); diff --git a/htdocs/class/xoopsform/formselectgroup.php b/htdocs/class/xoopsform/formselectgroup.php index 0dfa3bc3c..3eba56613 100644 --- a/htdocs/class/xoopsform/formselectgroup.php +++ b/htdocs/class/xoopsform/formselectgroup.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Parent diff --git a/htdocs/class/xoopsform/formselectlang.php b/htdocs/class/xoopsform/formselectlang.php index dfafca34b..b8b49b1f5 100644 --- a/htdocs/class/xoopsform/formselectlang.php +++ b/htdocs/class/xoopsform/formselectlang.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsLists'); xoops_load('XoopsFormSelect'); diff --git a/htdocs/class/xoopsform/formselectmatchoption.php b/htdocs/class/xoopsform/formselectmatchoption.php index 0678531bd..53b9e1ba0 100644 --- a/htdocs/class/xoopsform/formselectmatchoption.php +++ b/htdocs/class/xoopsform/formselectmatchoption.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsFormSelect'); diff --git a/htdocs/class/xoopsform/formselecttheme.php b/htdocs/class/xoopsform/formselecttheme.php index 30db0d36b..8713a688e 100644 --- a/htdocs/class/xoopsform/formselecttheme.php +++ b/htdocs/class/xoopsform/formselecttheme.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsLists'); xoops_load('XoopsFormSelect'); diff --git a/htdocs/class/xoopsform/formselecttimezone.php b/htdocs/class/xoopsform/formselecttimezone.php index 20a713298..4f787f466 100644 --- a/htdocs/class/xoopsform/formselecttimezone.php +++ b/htdocs/class/xoopsform/formselecttimezone.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * lists of values diff --git a/htdocs/class/xoopsform/formselectuser.php b/htdocs/class/xoopsform/formselectuser.php index 7db2e225e..8f0cade27 100644 --- a/htdocs/class/xoopsform/formselectuser.php +++ b/htdocs/class/xoopsform/formselectuser.php @@ -18,7 +18,9 @@ * @since 2.0.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsFormElementTray'); xoops_load('XoopsFormSelect'); diff --git a/htdocs/class/xoopsform/formtext.php b/htdocs/class/xoopsform/formtext.php index 44db9c06d..dcc14fb74 100644 --- a/htdocs/class/xoopsform/formtext.php +++ b/htdocs/class/xoopsform/formtext.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A simple text field diff --git a/htdocs/class/xoopsform/formtextarea.php b/htdocs/class/xoopsform/formtextarea.php index 4f6a43594..e06a45ecc 100644 --- a/htdocs/class/xoopsform/formtextarea.php +++ b/htdocs/class/xoopsform/formtextarea.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsFormElement'); diff --git a/htdocs/class/xoopsform/formtextdateselect.php b/htdocs/class/xoopsform/formtextdateselect.php index 42d540036..8488a742a 100644 --- a/htdocs/class/xoopsform/formtextdateselect.php +++ b/htdocs/class/xoopsform/formtextdateselect.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} /** * A text field with calendar popup diff --git a/htdocs/class/xoopsform/grouppermform.php b/htdocs/class/xoopsform/grouppermform.php index 69c6b4a47..0e46663e5 100644 --- a/htdocs/class/xoopsform/grouppermform.php +++ b/htdocs/class/xoopsform/grouppermform.php @@ -16,7 +16,9 @@ * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsFormElement'); xoops_load('XoopsFormHidden'); @@ -64,10 +66,10 @@ class XoopsGroupPermForm extends XoopsForm /** * Constructor - * @param $title - * @param $modid - * @param $permname - * @param $permdesc + * @param string $title + * @param string $modid + * @param string $permname + * @param string $permdesc * @param string $url * @param bool $anonymous */ @@ -211,10 +213,10 @@ class XoopsGroupFormCheckBox extends XoopsFormElement /** * Constructor - * @param $caption - * @param $name - * @param $groupId - * @param null $values + * @param string $caption + * @param string $name + * @param int $groupId + * @param mixed $values */ public function __construct($caption, $name, $groupId, $values = null) { diff --git a/htdocs/class/xoopsform/simpleform.php b/htdocs/class/xoopsform/simpleform.php index 361cca56e..b07970176 100644 --- a/htdocs/class/xoopsform/simpleform.php +++ b/htdocs/class/xoopsform/simpleform.php @@ -17,7 +17,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * base class diff --git a/htdocs/class/xoopsform/tableform.php b/htdocs/class/xoopsform/tableform.php index 0e82edf95..e8f036fa6 100644 --- a/htdocs/class/xoopsform/tableform.php +++ b/htdocs/class/xoopsform/tableform.php @@ -16,7 +16,9 @@ * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsForm'); diff --git a/htdocs/class/xoopsform/themeform.php b/htdocs/class/xoopsform/themeform.php index b78fc0764..ed2de636d 100644 --- a/htdocs/class/xoopsform/themeform.php +++ b/htdocs/class/xoopsform/themeform.php @@ -16,7 +16,9 @@ * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_load('XoopsForm'); diff --git a/htdocs/class/xoopskernel.php b/htdocs/class/xoopskernel.php index 3e99fe79c..6f4530e21 100644 --- a/htdocs/class/xoopskernel.php +++ b/htdocs/class/xoopskernel.php @@ -18,7 +18,9 @@ * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class xos_kernel_Xoops2 diff --git a/htdocs/class/xoopslists.php b/htdocs/class/xoopslists.php index cd350c630..938843efb 100644 --- a/htdocs/class/xoopslists.php +++ b/htdocs/class/xoopslists.php @@ -15,7 +15,9 @@ * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} if (!defined('XOOPS_LISTS_INCLUDED')) { define('XOOPS_LISTS_INCLUDED', 1); diff --git a/htdocs/class/xoopsload.php b/htdocs/class/xoopsload.php index c030b7a0a..a75558bff 100644 --- a/htdocs/class/xoopsload.php +++ b/htdocs/class/xoopsload.php @@ -16,7 +16,9 @@ * @author Taiwen Jiang * @todo For PHP 5 compliant */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class XoopsLoad diff --git a/htdocs/class/xoopslocal.php b/htdocs/class/xoopslocal.php index b2471dead..886c6ca12 100644 --- a/htdocs/class/xoopslocal.php +++ b/htdocs/class/xoopslocal.php @@ -16,7 +16,9 @@ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class XoopsLocalAbstract diff --git a/htdocs/class/xoopsmailer.php b/htdocs/class/xoopsmailer.php index 128dd368f..5e20fa3a8 100644 --- a/htdocs/class/xoopsmailer.php +++ b/htdocs/class/xoopsmailer.php @@ -17,7 +17,9 @@ * @deprecated use {@link XoopsMultiMailer} instead. */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_loadLanguage('mail'); @@ -151,7 +153,7 @@ public function reset() // public /** - * @param null $value + * @param string|null $value */ public function setTemplateDir($value = null) { @@ -503,8 +505,8 @@ public function getSuccess($ashtml = true) // public /** - * @param $tag - * @param null $value + * @param array|string $tag + * @param mixed $value */ public function assign($tag, $value = null) { diff --git a/htdocs/class/xoopsmodule.php b/htdocs/class/xoopsmodule.php index 48c0b6557..87aec49a0 100644 --- a/htdocs/class/xoopsmodule.php +++ b/htdocs/class/xoopsmodule.php @@ -15,7 +15,9 @@ * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} $GLOBALS['xoopsLogger']->addDeprecated("'/class/xoopsmodule.php' is deprecated since XOOPS 2.5.4, please use '/kernel/module.php' instead."); diff --git a/htdocs/class/xoopsobject.php b/htdocs/class/xoopsobject.php index b3b868f8f..f62c893cf 100644 --- a/htdocs/class/xoopsobject.php +++ b/htdocs/class/xoopsobject.php @@ -15,7 +15,9 @@ * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} $GLOBALS['xoopsLogger']->addDeprecated("'/class/xoopsobject.php' is deprecated since XOOPS 2.5.4, please use '/kernel/object.php' instead."); diff --git a/htdocs/class/xoopssecurity.php b/htdocs/class/xoopssecurity.php index ff19c46f2..df0311dfd 100644 --- a/htdocs/class/xoopssecurity.php +++ b/htdocs/class/xoopssecurity.php @@ -21,7 +21,9 @@ * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Class XoopsSecurity diff --git a/htdocs/class/xoopsstory.php b/htdocs/class/xoopsstory.php index 8e8819765..de1a327ec 100644 --- a/htdocs/class/xoopsstory.php +++ b/htdocs/class/xoopsstory.php @@ -17,7 +17,9 @@ * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('XOOPS root path not defined'); +} $GLOBALS['xoopsLogger']->addDeprecated("'/class/xoopstory.php' is deprecated since XOOPS 2.5.4, please create your own class instead."); include_once XOOPS_ROOT_PATH . '/class/xoopstopic.php'; diff --git a/htdocs/class/xoopstopic.php b/htdocs/class/xoopstopic.php index f3c98c50f..e58dcfa9b 100644 --- a/htdocs/class/xoopstopic.php +++ b/htdocs/class/xoopstopic.php @@ -17,7 +17,9 @@ * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} $GLOBALS['xoopsLogger']->addDeprecated("'/class/xoopstopic.php' is deprecated since XOOPS 2.5.4, please create your own class instead."); diff --git a/htdocs/class/xoopstree.php b/htdocs/class/xoopstree.php index bec4a1229..e70aa507f 100644 --- a/htdocs/class/xoopstree.php +++ b/htdocs/class/xoopstree.php @@ -16,7 +16,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Abstract base class for forms diff --git a/htdocs/class/xoopsuser.php b/htdocs/class/xoopsuser.php index bfa52963d..97e2bf4af 100644 --- a/htdocs/class/xoopsuser.php +++ b/htdocs/class/xoopsuser.php @@ -16,7 +16,9 @@ * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Path Change: This file is here for backward compatibility only. diff --git a/htdocs/class/zipdownloader.php b/htdocs/class/zipdownloader.php index 0ef2be31e..daea21d03 100644 --- a/htdocs/class/zipdownloader.php +++ b/htdocs/class/zipdownloader.php @@ -16,7 +16,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} include_once $GLOBALS['xoops']->path('class/downloader.php'); include_once $GLOBALS['xoops']->path('class/class.zipfile.php'); diff --git a/htdocs/footer.php b/htdocs/footer.php index 8dfcf0aab..b032974d2 100644 --- a/htdocs/footer.php +++ b/htdocs/footer.php @@ -15,7 +15,9 @@ * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} $xoopsPreload = XoopsPreload::getInstance(); $xoopsPreload->triggerEvent('core.footer.start'); diff --git a/htdocs/header.php b/htdocs/header.php index 1321bfb4f..27b19d67d 100644 --- a/htdocs/header.php +++ b/htdocs/header.php @@ -18,7 +18,9 @@ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} $xoopsPreload = XoopsPreload::getInstance(); $xoopsPreload->triggerEvent('core.header.start'); diff --git a/htdocs/include/checklogin.php b/htdocs/include/checklogin.php index c9d1bd4b0..d054dad2e 100644 --- a/htdocs/include/checklogin.php +++ b/htdocs/include/checklogin.php @@ -14,7 +14,9 @@ * @package core * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} xoops_loadLanguage('user'); diff --git a/htdocs/include/comment_constants.php b/htdocs/include/comment_constants.php index f22092b74..85ccceb1d 100644 --- a/htdocs/include/comment_constants.php +++ b/htdocs/include/comment_constants.php @@ -16,7 +16,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Comment Constants diff --git a/htdocs/include/comment_delete.php b/htdocs/include/comment_delete.php index 23eaf306b..48da8d417 100644 --- a/htdocs/include/comment_delete.php +++ b/htdocs/include/comment_delete.php @@ -17,7 +17,7 @@ */ if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) { - die('Restricted access'); + throw new \RuntimeException('Restricted access'); } include_once $GLOBALS['xoops']->path('include/comment_constants.php'); diff --git a/htdocs/include/comment_edit.php b/htdocs/include/comment_edit.php index 1d59fcac2..b374f1663 100644 --- a/htdocs/include/comment_edit.php +++ b/htdocs/include/comment_edit.php @@ -19,7 +19,7 @@ use Xmf\Request; if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) { - die('Restricted access'); + throw new \RuntimeException('Restricted access'); } include_once $GLOBALS['xoops']->path('include/comment_constants.php'); diff --git a/htdocs/include/comment_form.php b/htdocs/include/comment_form.php index f991caa89..48b923bee 100644 --- a/htdocs/include/comment_form.php +++ b/htdocs/include/comment_form.php @@ -19,7 +19,7 @@ use Xmf\Request; if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) { - die('Restricted access'); + throw new \RuntimeException('Restricted access'); } $com_modid = $xoopsModule->getVar('mid'); diff --git a/htdocs/include/comment_new.php b/htdocs/include/comment_new.php index 59376c0be..3cce83534 100644 --- a/htdocs/include/comment_new.php +++ b/htdocs/include/comment_new.php @@ -18,7 +18,9 @@ use Xmf\Request; -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} include_once $GLOBALS['xoops']->path('include/comment_constants.php'); diff --git a/htdocs/include/comment_post.php b/htdocs/include/comment_post.php index de9f0a603..1d1479dd1 100644 --- a/htdocs/include/comment_post.php +++ b/htdocs/include/comment_post.php @@ -18,7 +18,9 @@ use Xmf\Request; -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} include_once $GLOBALS['xoops']->path('include/comment_constants.php'); diff --git a/htdocs/include/comment_reply.php b/htdocs/include/comment_reply.php index d58c73a67..6b4ea812b 100644 --- a/htdocs/include/comment_reply.php +++ b/htdocs/include/comment_reply.php @@ -22,7 +22,9 @@ use Xmf\Request; -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} include_once $GLOBALS['xoops']->path('include/comment_constants.php'); diff --git a/htdocs/include/comment_view.php b/htdocs/include/comment_view.php index 8e771f3e5..3aa7d7c50 100644 --- a/htdocs/include/comment_view.php +++ b/htdocs/include/comment_view.php @@ -21,7 +21,7 @@ use Xmf\Request; if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) { - die('Restricted access'); + throw new \RuntimeException('Restricted access'); } include_once $GLOBALS['xoops']->path('include/comment_constants.php'); diff --git a/htdocs/include/commentform.inc.php b/htdocs/include/commentform.inc.php index fa83e70d7..6ca8004d8 100644 --- a/htdocs/include/commentform.inc.php +++ b/htdocs/include/commentform.inc.php @@ -19,7 +19,9 @@ /** @var XoopsConfigItem $xoopsConfig */ /** @var XoopsModule $xoopsModule */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} include_once $GLOBALS['xoops']->path('class/xoopslists.php'); include $GLOBALS['xoops']->path('class/xoopsformloader.php'); diff --git a/htdocs/include/defines.php b/htdocs/include/defines.php index 855844f3c..ee570b4e3 100644 --- a/htdocs/include/defines.php +++ b/htdocs/include/defines.php @@ -15,7 +15,9 @@ * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Define required Defines (I guess lol ) diff --git a/htdocs/include/functions.encoding.php b/htdocs/include/functions.encoding.php index 765f9b37a..caecc0520 100644 --- a/htdocs/include/functions.encoding.php +++ b/htdocs/include/functions.encoding.php @@ -21,7 +21,9 @@ * @since 2.4.0 * @author Simon */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * xoops_hex2bin() diff --git a/htdocs/include/functions.legacy.php b/htdocs/include/functions.legacy.php index 94df01e6e..2667d57b6 100644 --- a/htdocs/include/functions.legacy.php +++ b/htdocs/include/functions.legacy.php @@ -15,7 +15,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Deprecated functions diff --git a/htdocs/include/functions.php b/htdocs/include/functions.php index f2583a0ea..cc17a62b8 100644 --- a/htdocs/include/functions.php +++ b/htdocs/include/functions.php @@ -15,7 +15,9 @@ * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** @var \XoopsNotificationHandler $notification_handler */ @@ -1245,8 +1247,8 @@ function xoops_setConfigOption($option, $new = null) * * @param mixed $option * @param string $dirname - * @return bool -@deprecated + * @return mixed + * @deprecated */ function xoops_getModuleOption($option, $dirname = '') { diff --git a/htdocs/include/license.php b/htdocs/include/license.php index 01ad82c0c..9e73d0adb 100644 --- a/htdocs/include/license.php +++ b/htdocs/include/license.php @@ -19,7 +19,9 @@ * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} $licenseFile = (defined('XOOPS_VAR_PATH')) ? XOOPS_VAR_PATH . '/data/license.php' : ''; diff --git a/htdocs/include/mimetypes.inc.php b/htdocs/include/mimetypes.inc.php index 7f86dd779..49ebd8be2 100644 --- a/htdocs/include/mimetypes.inc.php +++ b/htdocs/include/mimetypes.inc.php @@ -14,7 +14,9 @@ * @package kernel * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Return a list of file Mimetypes diff --git a/htdocs/include/notification_constants.php b/htdocs/include/notification_constants.php index 56c37d230..c42d39363 100644 --- a/htdocs/include/notification_constants.php +++ b/htdocs/include/notification_constants.php @@ -16,7 +16,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} define('XOOPS_NOTIFICATION_MODE_SENDALWAYS', 0); define('XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE', 1); diff --git a/htdocs/include/notification_functions.php b/htdocs/include/notification_functions.php index 28345270c..73525fe5a 100644 --- a/htdocs/include/notification_functions.php +++ b/htdocs/include/notification_functions.php @@ -19,7 +19,9 @@ use Xmf\Request; -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} // RMV-NOTIFY diff --git a/htdocs/include/notification_select.php b/htdocs/include/notification_select.php index b2de2204b..eba1094e1 100644 --- a/htdocs/include/notification_select.php +++ b/htdocs/include/notification_select.php @@ -16,7 +16,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} include_once $GLOBALS['xoops']->path('include/notification_constants.php'); include_once $GLOBALS['xoops']->path('include/notification_functions.php'); diff --git a/htdocs/include/notification_update.php b/htdocs/include/notification_update.php index 130fb3268..b8cdf0a84 100644 --- a/htdocs/include/notification_update.php +++ b/htdocs/include/notification_update.php @@ -17,7 +17,7 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) { - die('Restricted access'); + throw new \RuntimeException('Restricted access'); } // RMV-NOTIFY diff --git a/htdocs/include/old_functions.php b/htdocs/include/old_functions.php index 33934034e..a1aa5610d 100644 --- a/htdocs/include/old_functions.php +++ b/htdocs/include/old_functions.php @@ -16,7 +16,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} trigger_error('Functions in ' . __FILE__ . ' are deprecated, should not be used any more', E_USER_WARNING); diff --git a/htdocs/include/registerform.php b/htdocs/include/registerform.php index cd52b767c..1fd1ebb64 100644 --- a/htdocs/include/registerform.php +++ b/htdocs/include/registerform.php @@ -14,7 +14,9 @@ * @package kernel * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} include_once $GLOBALS['xoops']->path('class/xoopslists.php'); include_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); diff --git a/htdocs/include/searchform.php b/htdocs/include/searchform.php index c559bf838..c21657f54 100644 --- a/htdocs/include/searchform.php +++ b/htdocs/include/searchform.php @@ -14,7 +14,9 @@ * @package kernel * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} include_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); diff --git a/htdocs/include/site-closed.php b/htdocs/include/site-closed.php index 433a8c2e5..6b0690132 100644 --- a/htdocs/include/site-closed.php +++ b/htdocs/include/site-closed.php @@ -17,7 +17,9 @@ * @since 2.0.17 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} global $xoopsConfig, $xoopsUser; diff --git a/htdocs/include/version.php b/htdocs/include/version.php index f43dc26c1..8c01adc74 100644 --- a/htdocs/include/version.php +++ b/htdocs/include/version.php @@ -13,7 +13,9 @@ * @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html) * @package kernel */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * YOU SHOULD NEVER TOUCH RELEVANT VARIABLES/FILES, THEY WILL BE REMOVED @@ -32,4 +34,4 @@ /** * Define XOOPS version */ -define('XOOPS_VERSION', 'XOOPS 2.5.12-Beta7'); +define('XOOPS_VERSION', 'XOOPS 2.5.12-Beta8'); diff --git a/htdocs/include/xoopscodes.php b/htdocs/include/xoopscodes.php index 418c538b8..d755d5f19 100644 --- a/htdocs/include/xoopscodes.php +++ b/htdocs/include/xoopscodes.php @@ -16,7 +16,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /**#@+ * @deprecated @@ -25,10 +27,10 @@ /** * Displays xoopsCode buttons and target textarea to which xoopscodes are inserted * - * @param string $textarea_id a unique id of the target textarea - * @param int $cols - * @param int $rows - * @param null $suffix + * @param string $textarea_id a unique id of the target textarea + * @param int $cols + * @param int $rows + * @param string|null $suffix */ function xoopsCodeTarea($textarea_id, $cols = 60, $rows = 15, $suffix = null) { diff --git a/htdocs/include/xoopslocal.php b/htdocs/include/xoopslocal.php index e44290c4b..5b0455952 100644 --- a/htdocs/include/xoopslocal.php +++ b/htdocs/include/xoopslocal.php @@ -15,7 +15,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * XoopsLocalWrapper @@ -24,7 +26,7 @@ class XoopsLocalWrapper { /** - * @param null $language + * @param mixed $language * * @return bool */ diff --git a/htdocs/install/include/license.dist.php b/htdocs/install/include/license.dist.php index 047ba14e9..52fd56b7d 100644 --- a/htdocs/install/include/license.dist.php +++ b/htdocs/install/include/license.dist.php @@ -19,7 +19,9 @@ * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @deprecated */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} define('XOOPS_LICENSE_CODE', 'GPL'); define('XOOPS_LICENSE_TEXT', 'GPL General Public License (GPL) (v. 2.0)'); diff --git a/htdocs/kernel/avatar.php b/htdocs/kernel/avatar.php index 33b3b5c8d..606a4cd03 100644 --- a/htdocs/kernel/avatar.php +++ b/htdocs/kernel/avatar.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A Avatar @@ -419,7 +421,7 @@ public function getList($avatar_type = null, $avatar_display = null) $criteria->add(new Criteria('avatar_type', $avatar_type)); } if (isset($avatar_display)) { - $criteria->add(new Criteria('avatar_display', (int) $avatar_display)); + $criteria->add(new Criteria('avatar_display', (string) ((int) $avatar_display))); } $avatars = &$this->getObjects($criteria, true); $ret = ['blank.gif' => _NONE]; diff --git a/htdocs/kernel/block.php b/htdocs/kernel/block.php index fcdc920b9..e3efaed16 100644 --- a/htdocs/kernel/block.php +++ b/htdocs/kernel/block.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A block @@ -89,8 +91,8 @@ public function __construct($id = null) if (is_array($id)) { $this->assignVars($id); } else { - $blkhandler = xoops_getHandler('block'); - $obj = $blkhandler->get($id); + $blockHandler = xoops_getHandler('block'); + $obj = $blockHandler->get($id); foreach (array_keys($obj->getVars()) as $i) { $this->assignVar($i, $obj->getVar($i, 'n')); } @@ -435,9 +437,9 @@ public function isCustom() public function load($id) { $id = (int) $id; - /** @var XoopsBlockHandler $blkhandler */ - $blkhandler = xoops_getHandler('block'); - $obj = $blkhandler->get($id); + /** @var XoopsBlockHandler $blockHandler */ + $blockHandler = xoops_getHandler('block'); + $obj = $blockHandler->get($id); foreach (array_keys($obj->getVars()) as $i) { $this->assignVar($i, $obj->getVar($i, 'n')); } @@ -452,9 +454,9 @@ public function load($id) */ public function store() { - /** @var XoopsBlockHandler $blkhandler */ - $blkhandler = xoops_getHandler('block'); - if (false === $blkhandler->insert($this)) { + /** @var XoopsBlockHandler $blockHandler */ + $blockHandler = xoops_getHandler('block'); + if (false === $blockHandler->insert($this)) { return false; } return (int) $this->bid(); @@ -469,9 +471,9 @@ public function store() */ public function delete() { - /** @var XoopsBlockHandler $blkhandler */ - $blkhandler = xoops_getHandler('block'); - return $blkhandler->delete($this); + /** @var XoopsBlockHandler $blockHandler */ + $blockHandler = xoops_getHandler('block'); + return $blockHandler->delete($this); } /** @@ -569,18 +571,18 @@ public function buildTitle($originaltitle, $newtitle = '') /** * get all the blocks that match the supplied parameters - * @param int|array $groupid groupid (can be an array) - * @param bool $asobject - * @param null|string $side 0: sideblock - left - * 1: sideblock - right - * 2: sideblock - left and right - * 3: centerblock - left - * 4: centerblock - right - * 5: centerblock - center - * 6: centerblock - left, right, center - * @param $visible 0: not visible 1: visible - * @param string $orderby order of the blocks - * @param int $isactive + * @param int|array $groupid groupid (can be an array) + * @param bool $asobject + * @param string|null $side 0: sideblock - left + * 1: sideblock - right + * 2: sideblock - left and right + * 3: centerblock - left + * 4: centerblock - right + * 5: centerblock - center + * 6: centerblock - left, right, center + * @param $visible 0: not visible 1: visible + * @param string $orderby order of the blocks + * @param int $isactive * @returns array of block objects * * @deprecated @@ -1214,10 +1216,10 @@ public function getByModule($moduleid, $asobject = true, $id_as_key = false) } /** - * @param $groupid + * @param mixed $groupid * @param int $module_id * @param bool $toponlyblock - * @param null $visible + * @param mixed $visible * @param string $orderby * @param int $isactive * diff --git a/htdocs/kernel/blockinstance.php b/htdocs/kernel/blockinstance.php index 5ab29e32d..fb4f2b308 100644 --- a/htdocs/kernel/blockinstance.php +++ b/htdocs/kernel/blockinstance.php @@ -18,7 +18,9 @@ * XOOPS Block legacy Instance handler * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Xoops Block Instance diff --git a/htdocs/kernel/comment.php b/htdocs/kernel/comment.php index aed542d69..e2bfdb3dc 100644 --- a/htdocs/kernel/comment.php +++ b/htdocs/kernel/comment.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A Comment diff --git a/htdocs/kernel/config.php b/htdocs/kernel/config.php index 72d7167bb..0022f533e 100644 --- a/htdocs/kernel/config.php +++ b/htdocs/kernel/config.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} require_once $GLOBALS['xoops']->path('kernel/configoption.php'); require_once $GLOBALS['xoops']->path('kernel/configitem.php'); diff --git a/htdocs/kernel/configcategory.php b/htdocs/kernel/configcategory.php index df24ff535..42b47d56b 100644 --- a/htdocs/kernel/configcategory.php +++ b/htdocs/kernel/configcategory.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A category of configs diff --git a/htdocs/kernel/configitem.php b/htdocs/kernel/configitem.php index 39072d45c..cea3a0509 100644 --- a/htdocs/kernel/configitem.php +++ b/htdocs/kernel/configitem.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /**#@+ * Config type diff --git a/htdocs/kernel/configoption.php b/htdocs/kernel/configoption.php index 17db481a0..a54b2495f 100644 --- a/htdocs/kernel/configoption.php +++ b/htdocs/kernel/configoption.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A Config-Option diff --git a/htdocs/kernel/group.php b/htdocs/kernel/group.php index c7137e62a..a578bffae 100644 --- a/htdocs/kernel/group.php +++ b/htdocs/kernel/group.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * a group of users diff --git a/htdocs/kernel/groupperm.php b/htdocs/kernel/groupperm.php index 5017a06d2..45d2b7df8 100644 --- a/htdocs/kernel/groupperm.php +++ b/htdocs/kernel/groupperm.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A group permission diff --git a/htdocs/kernel/handlerregistry.php b/htdocs/kernel/handlerregistry.php index 049f2c7b4..eb87d8dc0 100644 --- a/htdocs/kernel/handlerregistry.php +++ b/htdocs/kernel/handlerregistry.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A registry for holding references to {@link XoopsObjectHandler} classes diff --git a/htdocs/kernel/image.php b/htdocs/kernel/image.php index 5aeb5ae84..7d9d5f1c1 100644 --- a/htdocs/kernel/image.php +++ b/htdocs/kernel/image.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * An Image @@ -364,14 +366,14 @@ public function getCount(?CriteriaElement $criteria = null) * Get a list of images * * @param int $imgcat_id - * @param bool $image_display + * @param bool|null $image_display * @return array Array of {@link XoopsImage} objects **/ public function getList($imgcat_id, $image_display = null) { $criteria = new CriteriaCompo(new Criteria('imgcat_id', (int)$imgcat_id)); if (isset($image_display)) { - $criteria->add(new Criteria('image_display', (int)$image_display)); + $criteria->add(new Criteria('image_display', (string) ((int)$image_display))); } $images = $this->getObjects($criteria, false, true); $ret = []; diff --git a/htdocs/kernel/imagecategory.php b/htdocs/kernel/imagecategory.php index ba4ad09b8..58b73435e 100644 --- a/htdocs/kernel/imagecategory.php +++ b/htdocs/kernel/imagecategory.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * @author Kazumi Ono @@ -361,13 +363,13 @@ public function getCount(?CriteriaElement $criteria = null) /** * Get a list of image categories * - * @param array $groups - * @param string $perm - * @param null $display - * @param null $storetype - * @internal param int $imgcat_id - * @internal param bool $image_display + * @param array $groups + * @param string $perm + * @param int|string|bool|null $display + * @param string|null $storetype * @return array Array of {@link XoopsImage} objects + * @internal param bool $image_display + * @internal param int $imgcat_id */ public function getList($groups = [], $perm = 'imgcat_read', $display = null, $storetype = null) { @@ -384,7 +386,7 @@ public function getList($groups = [], $perm = 'imgcat_read', $display = null, $s } } if (isset($display)) { - $criteria->add(new Criteria('imgcat_display', (int)$display)); + $criteria->add(new Criteria('imgcat_display', (string) ((int)$display))); } if (isset($storetype)) { $criteria->add(new Criteria('imgcat_storetype', $storetype)); diff --git a/htdocs/kernel/imageset.php b/htdocs/kernel/imageset.php index 09f2c4bed..633dc9a12 100644 --- a/htdocs/kernel/imageset.php +++ b/htdocs/kernel/imageset.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * @author Kazumi Ono @@ -294,8 +296,8 @@ public function unlinkThemeset($imgset_id, $tplset_name) /** * Get a list of XoopsImageSet * - * @param null $refid - * @param null $tplset + * @param int|string|null $refid + * @param string|null $tplset * @internal param int $imgcat_id * @internal param bool $image_display * @return array Array of {@link XoopsImage} objects @@ -304,7 +306,7 @@ public function getList($refid = null, $tplset = null) { $criteria = new CriteriaCompo(); if (isset($refid)) { - $criteria->add(new Criteria('imgset_refid', (int)$refid)); + $criteria->add(new Criteria('imgset_refid', (string) ((int)$refid))); } if (isset($tplset)) { $criteria->add(new Criteria('tplset_name', $tplset)); diff --git a/htdocs/kernel/imagesetimg.php b/htdocs/kernel/imagesetimg.php index 5481cc438..0a606fa4b 100644 --- a/htdocs/kernel/imagesetimg.php +++ b/htdocs/kernel/imagesetimg.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * XOOPS Image Sets Image diff --git a/htdocs/kernel/member.php b/htdocs/kernel/member.php index d40d9fea6..0b648ef8d 100644 --- a/htdocs/kernel/member.php +++ b/htdocs/kernel/member.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} require_once __DIR__ . '/user.php'; require_once __DIR__ . '/group.php'; diff --git a/htdocs/kernel/module.php b/htdocs/kernel/module.php index 058319913..a846469a7 100644 --- a/htdocs/kernel/module.php +++ b/htdocs/kernel/module.php @@ -14,7 +14,9 @@ * @package kernel * @since 2.0.0 */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A Module @@ -1010,7 +1012,7 @@ public function getCount(?CriteriaElement $criteria = null) /** * returns an array of module names * - * @param CriteriaElement $criteria + * @param CriteriaElement|null $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 diff --git a/htdocs/kernel/notification.php b/htdocs/kernel/notification.php index ae1babf5d..004b7e8df 100644 --- a/htdocs/kernel/notification.php +++ b/htdocs/kernel/notification.php @@ -16,7 +16,9 @@ * @author Michael van Dam * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} // RMV-NOTIFY include_once $GLOBALS['xoops']->path('include/notification_constants.php'); @@ -588,10 +590,8 @@ public function getSubscribedEvents($category, $item_id, $module_id, $user_id) * * @param int $module_id Module ID * @param int $item_id Item ID - * @param string $order Sort order - * @param int $mode not_mode see include/notification_constants.php - * - * @param null $status + * @param string|null $order Sort order + * @param int|null $mode not_mode see include/notification_constants.php * * @return array Array of {@link XoopsNotification} objects */ diff --git a/htdocs/kernel/object.php b/htdocs/kernel/object.php index 99bb25a59..93a5387a2 100644 --- a/htdocs/kernel/object.php +++ b/htdocs/kernel/object.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * YOU SHOULD NOT USE ANY OF THE UNICODE TYPES, THEY WILL BE REMOVED */ @@ -1188,7 +1190,7 @@ class XoopsPersistableObjectHandler extends XoopsObjectHandler /** * Constructor * - * @param null|XoopsDatabase $db database connection + * @param XoopsDatabase|null $db database connection * @param string $table Name of database table * @param string $className Name of the XoopsObject class this handler manages * @param string $keyName Name of the property holding the key @@ -1211,7 +1213,7 @@ public function __construct(?\XoopsDatabase $db = null, $table = '', $className /** * PHP 4 style constructor compatibility shim * - * @param null|XoopsDatabase $db database connection + * @param XoopsDatabase|null $db database connection * @param string $table Name of database table * @param string $className Name of the XoopsObject class this handler manages * @param string $keyName Name of the property holding the key @@ -1231,9 +1233,9 @@ public function XoopsPersistableObjectHandler(?\XoopsDatabase $db = null, $table * Set custom handler * * @access protected - * @param null|string $handler - * @param null $args - * @param string $path path to class + * @param mixed $handler + * @param mixed $args + * @param string|null $path path to class * @internal param object $handler * @internal param mixed $args * @return object of handler diff --git a/htdocs/kernel/online.php b/htdocs/kernel/online.php index 6ff5aecda..0a9d1cc68 100644 --- a/htdocs/kernel/online.php +++ b/htdocs/kernel/online.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A handler for "Who is Online?" information diff --git a/htdocs/kernel/privmessage.php b/htdocs/kernel/privmessage.php index d81d7c163..6b3966f8a 100644 --- a/htdocs/kernel/privmessage.php +++ b/htdocs/kernel/privmessage.php @@ -15,7 +15,9 @@ * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Private Messages diff --git a/htdocs/kernel/session.php b/htdocs/kernel/session.php index 58da48563..066b210fd 100644 --- a/htdocs/kernel/session.php +++ b/htdocs/kernel/session.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Handler for a session diff --git a/htdocs/kernel/tplfile.php b/htdocs/kernel/tplfile.php index 625b2754d..8a223ef63 100644 --- a/htdocs/kernel/tplfile.php +++ b/htdocs/kernel/tplfile.php @@ -16,7 +16,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A Template File diff --git a/htdocs/kernel/tplset.php b/htdocs/kernel/tplset.php index 5a51a2140..dc4ef21b1 100644 --- a/htdocs/kernel/tplset.php +++ b/htdocs/kernel/tplset.php @@ -16,7 +16,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * A Template Set File diff --git a/htdocs/kernel/user.php b/htdocs/kernel/user.php index 5ba99c2f2..df042f7e6 100644 --- a/htdocs/kernel/user.php +++ b/htdocs/kernel/user.php @@ -16,7 +16,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} require_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; diff --git a/htdocs/language/english/formdhtmltextarea.php b/htdocs/language/english/formdhtmltextarea.php index 2391b5c89..d496e89a8 100644 --- a/htdocs/language/english/formdhtmltextarea.php +++ b/htdocs/language/english/formdhtmltextarea.php @@ -16,7 +16,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} // _LANGCODE: en // _CHARSET : UTF-8 diff --git a/htdocs/language/english/locale.php b/htdocs/language/english/locale.php index 976d1a4e7..1e52bd6c5 100644 --- a/htdocs/language/english/locale.php +++ b/htdocs/language/english/locale.php @@ -19,7 +19,9 @@ * @author Taiwen Jiang * @todo To be handled by i18n/l10n */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} setlocale(LC_ALL, 'en_US'); diff --git a/htdocs/language/english/logger.php b/htdocs/language/english/logger.php index c800b95a0..0a485295c 100644 --- a/htdocs/language/english/logger.php +++ b/htdocs/language/english/logger.php @@ -19,7 +19,9 @@ * @since 2.4.0 * @author trabis */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} // _LANGCODE: en // _CHARSET : UTF-8 diff --git a/htdocs/language/english/xoopsmailerlocal.php b/htdocs/language/english/xoopsmailerlocal.php index cf2c16754..9cdf23990 100644 --- a/htdocs/language/english/xoopsmailerlocal.php +++ b/htdocs/language/english/xoopsmailerlocal.php @@ -18,7 +18,9 @@ * @since 2.3.0 * @author Taiwen Jiang */ -defined('XOOPS_ROOT_PATH') || exit('Restricted access'); +if (!defined('XOOPS_ROOT_PATH')) { + throw new \RuntimeException('Restricted access'); +} /** * Localize the mail functions * diff --git a/htdocs/modules/pm/admin/menu.php b/htdocs/modules/pm/admin/menu.php index 81ff06adc..c30487606 100644 --- a/htdocs/modules/pm/admin/menu.php +++ b/htdocs/modules/pm/admin/menu.php @@ -16,7 +16,9 @@ * @author Taiwen Jiang */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} $path = dirname(__DIR__, 3); include_once $path . '/mainfile.php'; diff --git a/htdocs/modules/pm/include/update.php b/htdocs/modules/pm/include/update.php index cb15b4cea..a2043fcfc 100644 --- a/htdocs/modules/pm/include/update.php +++ b/htdocs/modules/pm/include/update.php @@ -20,13 +20,8 @@ require_once $path . '/include' . '/cp_header.php'; /** - * @param $module - * @param null $oldversion - * @return bool - */ -/** - * @param $module - * @param null $oldversion + * @param XoopsModule $module + * @param string|null $oldversion * @return bool */ function xoops_module_update_pm(XoopsModule $module, $oldversion = null) diff --git a/htdocs/modules/pm/preloads/core.php b/htdocs/modules/pm/preloads/core.php index 989137c92..b3afe05d6 100644 --- a/htdocs/modules/pm/preloads/core.php +++ b/htdocs/modules/pm/preloads/core.php @@ -16,7 +16,9 @@ * @author trabis */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * PM core preloads diff --git a/htdocs/modules/pm/preloads/system.php b/htdocs/modules/pm/preloads/system.php index b6f4a3aa0..4ca7a12f8 100644 --- a/htdocs/modules/pm/preloads/system.php +++ b/htdocs/modules/pm/preloads/system.php @@ -16,7 +16,9 @@ * @author trabis */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * PM system preloads diff --git a/htdocs/modules/profile/admin/menu.php b/htdocs/modules/profile/admin/menu.php index e546f8b3e..be28a4edd 100644 --- a/htdocs/modules/profile/admin/menu.php +++ b/htdocs/modules/profile/admin/menu.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} $path = dirname(__DIR__, 3); include_once $path . '/mainfile.php'; diff --git a/htdocs/modules/profile/class/category.php b/htdocs/modules/profile/class/category.php index f57db63b0..613b8fce2 100644 --- a/htdocs/modules/profile/class/category.php +++ b/htdocs/modules/profile/class/category.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang */ -// defined('XOOPS_ROOT_PATH') || exit("XOOPS root path not defined"); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * @package kernel @@ -80,7 +82,7 @@ public function getForm($action = false) class ProfileCategoryHandler extends XoopsPersistableObjectHandler { /** - * @param null|XoopsDatabase $db + * @param XoopsDatabase|null $db */ public function __construct(XoopsDatabase $db) { diff --git a/htdocs/modules/profile/class/field.php b/htdocs/modules/profile/class/field.php index 97f203c90..c1fca9dc1 100644 --- a/htdocs/modules/profile/class/field.php +++ b/htdocs/modules/profile/class/field.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang */ -// defined('XOOPS_ROOT_PATH') || exit("XOOPS root path not defined"); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * @package kernel @@ -432,7 +434,7 @@ class ProfileFieldHandler extends XoopsPersistableObjectHandler public $table_link; /** - * @param null|XoopsDatabase $db + * @param XoopsDatabase|null $db */ public function __construct(XoopsDatabase $db) { diff --git a/htdocs/modules/profile/class/profile.php b/htdocs/modules/profile/class/profile.php index 83e1c246e..01a9b372b 100644 --- a/htdocs/modules/profile/class/profile.php +++ b/htdocs/modules/profile/class/profile.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang */ -// defined('XOOPS_ROOT_PATH') || exit("XOOPS root path not defined"); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * @package kernel @@ -69,7 +71,7 @@ class ProfileProfileHandler extends XoopsPersistableObjectHandler public $_fields = []; /** - * @param null|XoopsDatabase $db + * @param XoopsDatabase|null $db */ public function __construct(XoopsDatabase $db) { diff --git a/htdocs/modules/profile/class/regstep.php b/htdocs/modules/profile/class/regstep.php index 8577e0c98..3daea5a61 100644 --- a/htdocs/modules/profile/class/regstep.php +++ b/htdocs/modules/profile/class/regstep.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang */ -// defined('XOOPS_ROOT_PATH') || exit("XOOPS root path not defined"); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * Class ProfileRegstep diff --git a/htdocs/modules/profile/class/visibility.php b/htdocs/modules/profile/class/visibility.php index 0bfa7f131..0c29988e4 100644 --- a/htdocs/modules/profile/class/visibility.php +++ b/htdocs/modules/profile/class/visibility.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang */ -// defined('XOOPS_ROOT_PATH') || exit("XOOPS root path not defined"); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * Class ProfileVisibility @@ -45,7 +47,7 @@ public function __construct() class ProfileVisibilityHandler extends XoopsPersistableObjectHandler { /** - * @param null|XoopsDatabase $db + * @param XoopsDatabase|null $db */ public function __construct(XoopsDatabase $db) { diff --git a/htdocs/modules/profile/include/forms.php b/htdocs/modules/profile/include/forms.php index 02e8d6b34..4da212762 100644 --- a/htdocs/modules/profile/include/forms.php +++ b/htdocs/modules/profile/include/forms.php @@ -17,7 +17,9 @@ * @author Taiwen Jiang */ -// defined('XOOPS_ROOT_PATH') || exit("XOOPS root path not defined"); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * Get {@link XoopsThemeForm} for adding/editing fields diff --git a/htdocs/modules/profile/preloads/core.php b/htdocs/modules/profile/preloads/core.php index 1f0c0f3ba..425cb6bbf 100644 --- a/htdocs/modules/profile/preloads/core.php +++ b/htdocs/modules/profile/preloads/core.php @@ -18,7 +18,9 @@ use Xmf\Request; -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * Profile core preloads diff --git a/htdocs/modules/protector/preloads/core.php b/htdocs/modules/protector/preloads/core.php index 8c4ba85ea..a900d597e 100644 --- a/htdocs/modules/protector/preloads/core.php +++ b/htdocs/modules/protector/preloads/core.php @@ -16,7 +16,9 @@ * @author trabis */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * Protector core preloads diff --git a/htdocs/modules/system/admin.php b/htdocs/modules/system/admin.php index db2ffa0c3..53d59073d 100644 --- a/htdocs/modules/system/admin.php +++ b/htdocs/modules/system/admin.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/avatars/main.php b/htdocs/modules/system/admin/avatars/main.php index 9a80db432..4c27a1095 100644 --- a/htdocs/modules/system/admin/avatars/main.php +++ b/htdocs/modules/system/admin/avatars/main.php @@ -12,7 +12,7 @@ use Xmf\Request; /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/avatars/xoops_version.php b/htdocs/modules/system/admin/avatars/xoops_version.php index b98d10eee..2db6df019 100644 --- a/htdocs/modules/system/admin/avatars/xoops_version.php +++ b/htdocs/modules/system/admin/avatars/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/banners/xoops_version.php b/htdocs/modules/system/admin/banners/xoops_version.php index 693684ab0..dd9b79191 100644 --- a/htdocs/modules/system/admin/banners/xoops_version.php +++ b/htdocs/modules/system/admin/banners/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/blocksadmin/main.php b/htdocs/modules/system/admin/blocksadmin/main.php index 5e4b9376a..44fc1f710 100644 --- a/htdocs/modules/system/admin/blocksadmin/main.php +++ b/htdocs/modules/system/admin/blocksadmin/main.php @@ -12,7 +12,7 @@ use Xmf\Request; /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/blocksadmin/xoops_version.php b/htdocs/modules/system/admin/blocksadmin/xoops_version.php index dbe47b130..2178d6e6d 100644 --- a/htdocs/modules/system/admin/blocksadmin/xoops_version.php +++ b/htdocs/modules/system/admin/blocksadmin/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/comments/main.php b/htdocs/modules/system/admin/comments/main.php index bf2943802..deda10546 100644 --- a/htdocs/modules/system/admin/comments/main.php +++ b/htdocs/modules/system/admin/comments/main.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/comments/xoops_version.php b/htdocs/modules/system/admin/comments/xoops_version.php index 17e15b039..c8ceb8630 100644 --- a/htdocs/modules/system/admin/comments/xoops_version.php +++ b/htdocs/modules/system/admin/comments/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/groupperm.php b/htdocs/modules/system/admin/groupperm.php index f9613a3aa..fea4872f8 100644 --- a/htdocs/modules/system/admin/groupperm.php +++ b/htdocs/modules/system/admin/groupperm.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/groups/main.php b/htdocs/modules/system/admin/groups/main.php index 953b1896c..9a8bee6dd 100644 --- a/htdocs/modules/system/admin/groups/main.php +++ b/htdocs/modules/system/admin/groups/main.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/groups/xoops_version.php b/htdocs/modules/system/admin/groups/xoops_version.php index ee56cd48d..ff95ca41a 100644 --- a/htdocs/modules/system/admin/groups/xoops_version.php +++ b/htdocs/modules/system/admin/groups/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/images/main.php b/htdocs/modules/system/admin/images/main.php index 81211c5db..b16077ab2 100644 --- a/htdocs/modules/system/admin/images/main.php +++ b/htdocs/modules/system/admin/images/main.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/images/xoops_version.php b/htdocs/modules/system/admin/images/xoops_version.php index 028c7d7f9..17b442e58 100644 --- a/htdocs/modules/system/admin/images/xoops_version.php +++ b/htdocs/modules/system/admin/images/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/mailusers/main.php b/htdocs/modules/system/admin/mailusers/main.php index 879d28215..c80aa6d53 100644 --- a/htdocs/modules/system/admin/mailusers/main.php +++ b/htdocs/modules/system/admin/mailusers/main.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/mailusers/xoops_version.php b/htdocs/modules/system/admin/mailusers/xoops_version.php index f3025fc1b..325bee16c 100644 --- a/htdocs/modules/system/admin/mailusers/xoops_version.php +++ b/htdocs/modules/system/admin/mailusers/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/modulesadmin/main.php b/htdocs/modules/system/admin/modulesadmin/main.php index 71d3924af..9e425399d 100644 --- a/htdocs/modules/system/admin/modulesadmin/main.php +++ b/htdocs/modules/system/admin/modulesadmin/main.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/modulesadmin/modulesadmin.php b/htdocs/modules/system/admin/modulesadmin/modulesadmin.php index 421f985de..82d640971 100644 --- a/htdocs/modules/system/admin/modulesadmin/modulesadmin.php +++ b/htdocs/modules/system/admin/modulesadmin/modulesadmin.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/modulesadmin/xoops_version.php b/htdocs/modules/system/admin/modulesadmin/xoops_version.php index 1c2d78b3e..20268715a 100644 --- a/htdocs/modules/system/admin/modulesadmin/xoops_version.php +++ b/htdocs/modules/system/admin/modulesadmin/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/preferences/main.php b/htdocs/modules/system/admin/preferences/main.php index 93c724b55..c9f36db7b 100644 --- a/htdocs/modules/system/admin/preferences/main.php +++ b/htdocs/modules/system/admin/preferences/main.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/preferences/xoops_version.php b/htdocs/modules/system/admin/preferences/xoops_version.php index a4381bbb1..04c23f664 100644 --- a/htdocs/modules/system/admin/preferences/xoops_version.php +++ b/htdocs/modules/system/admin/preferences/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/smilies/main.php b/htdocs/modules/system/admin/smilies/main.php index 2f7a1670c..327db4070 100644 --- a/htdocs/modules/system/admin/smilies/main.php +++ b/htdocs/modules/system/admin/smilies/main.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/smilies/xoops_version.php b/htdocs/modules/system/admin/smilies/xoops_version.php index 0677ce1b4..7a0c28559 100644 --- a/htdocs/modules/system/admin/smilies/xoops_version.php +++ b/htdocs/modules/system/admin/smilies/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/tplsets/jquery.php b/htdocs/modules/system/admin/tplsets/jquery.php index b54d5b500..600c49165 100644 --- a/htdocs/modules/system/admin/tplsets/jquery.php +++ b/htdocs/modules/system/admin/tplsets/jquery.php @@ -25,7 +25,9 @@ include dirname(__DIR__, 2) . '/header.php'; -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) { exit(_NOPERM); diff --git a/htdocs/modules/system/admin/tplsets/main.php b/htdocs/modules/system/admin/tplsets/main.php index 01e587dae..cfbfbe068 100644 --- a/htdocs/modules/system/admin/tplsets/main.php +++ b/htdocs/modules/system/admin/tplsets/main.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/tplsets/xoops_version.php b/htdocs/modules/system/admin/tplsets/xoops_version.php index 123256124..d1f5cc16c 100644 --- a/htdocs/modules/system/admin/tplsets/xoops_version.php +++ b/htdocs/modules/system/admin/tplsets/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/userrank/main.php b/htdocs/modules/system/admin/userrank/main.php index 838238ce9..e72278038 100644 --- a/htdocs/modules/system/admin/userrank/main.php +++ b/htdocs/modules/system/admin/userrank/main.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/userrank/xoops_version.php b/htdocs/modules/system/admin/userrank/xoops_version.php index c05adcdf7..d014b3711 100644 --- a/htdocs/modules/system/admin/userrank/xoops_version.php +++ b/htdocs/modules/system/admin/userrank/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/users/jquery.php b/htdocs/modules/system/admin/users/jquery.php index 68030a792..806c43305 100644 --- a/htdocs/modules/system/admin/users/jquery.php +++ b/htdocs/modules/system/admin/users/jquery.php @@ -22,7 +22,9 @@ require dirname(__DIR__, 4) . '/mainfile.php'; require XOOPS_ROOT_PATH . '/header.php'; -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) { exit(_NOPERM); diff --git a/htdocs/modules/system/admin/users/main.php b/htdocs/modules/system/admin/users/main.php index aab105a4a..ec82eea77 100644 --- a/htdocs/modules/system/admin/users/main.php +++ b/htdocs/modules/system/admin/users/main.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/users/users.php b/htdocs/modules/system/admin/users/users.php index 9da69f3e6..cc37a76f5 100644 --- a/htdocs/modules/system/admin/users/users.php +++ b/htdocs/modules/system/admin/users/users.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/admin/users/xoops_version.php b/htdocs/modules/system/admin/users/xoops_version.php index 111a29fa6..3de5b52d7 100644 --- a/htdocs/modules/system/admin/users/xoops_version.php +++ b/htdocs/modules/system/admin/users/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/blocks/system_blocks.php b/htdocs/modules/system/blocks/system_blocks.php index 49d2230b6..9d8c3bd92 100644 --- a/htdocs/modules/system/blocks/system_blocks.php +++ b/htdocs/modules/system/blocks/system_blocks.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/modules/system/class/avatar.php b/htdocs/modules/system/class/avatar.php index bc151ba96..4e0871283 100644 --- a/htdocs/modules/system/class/avatar.php +++ b/htdocs/modules/system/class/avatar.php @@ -14,7 +14,9 @@ * @package system */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} include_once $GLOBALS['xoops']->path('/kernel/avatar.php'); diff --git a/htdocs/modules/system/class/banner.php b/htdocs/modules/system/class/banner.php index c760b6446..ac5213a30 100644 --- a/htdocs/modules/system/class/banner.php +++ b/htdocs/modules/system/class/banner.php @@ -15,7 +15,9 @@ * @package system */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * System Banner @@ -112,7 +114,7 @@ public function getForm($action = false) class SystemBannerHandler extends XoopsPersistableObjectHandler { /** - * @param null|object $db + * @param XoopsDatabase|null $db */ public function __construct($db) { diff --git a/htdocs/modules/system/class/bannerclient.php b/htdocs/modules/system/class/bannerclient.php index 719e509f1..1185ee9a3 100644 --- a/htdocs/modules/system/class/bannerclient.php +++ b/htdocs/modules/system/class/bannerclient.php @@ -16,7 +16,9 @@ * @package system */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * System Banner Client diff --git a/htdocs/modules/system/class/bannerfinish.php b/htdocs/modules/system/class/bannerfinish.php index ddd234d54..23021b880 100644 --- a/htdocs/modules/system/class/bannerfinish.php +++ b/htdocs/modules/system/class/bannerfinish.php @@ -16,7 +16,9 @@ * @package system */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * System Banner Finish @@ -62,7 +64,7 @@ public function __construct() class SystemBannerfinishHandler extends XoopsPersistableObjectHandler { /** - * @param null|XoopsDatabase $db + * @param XoopsDatabase|null $db */ public function __construct(XoopsDatabase $db) { diff --git a/htdocs/modules/system/class/block.php b/htdocs/modules/system/class/block.php index cd222140c..2435fce9b 100644 --- a/htdocs/modules/system/class/block.php +++ b/htdocs/modules/system/class/block.php @@ -13,7 +13,9 @@ * @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html) * @package system */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} require_once XOOPS_ROOT_PATH . '/kernel/block.php'; @@ -312,7 +314,7 @@ public function getContent($format = 's', $c_type = 'T') class SystemBlockHandler extends XoopsPersistableObjectHandler { /** - * @param null|XoopsDatabase $db + * @param XoopsDatabase|null $db */ public function __construct(XoopsDatabase $db) { @@ -507,10 +509,10 @@ public function getBlockByPerm($groupid) } /** - * @param $groupid + * @param mixed $groupid * @param int $module_id * @param bool $toponlyblock - * @param null $visible + * @param mixed $visible * @param string $orderby * @param int $isactive * @@ -587,7 +589,7 @@ public function getAllByGroupModule($groupid, $module_id = 0, $toponlyblock = fa /** * @param int $module_id * @param bool $toponlyblock - * @param null $visible + * @param int|bool|null $visible * @param string $orderby * @param int $isactive * diff --git a/htdocs/modules/system/class/blocklinkmodule.php b/htdocs/modules/system/class/blocklinkmodule.php index 4465a7582..8b2e3023c 100644 --- a/htdocs/modules/system/class/blocklinkmodule.php +++ b/htdocs/modules/system/class/blocklinkmodule.php @@ -13,7 +13,9 @@ * @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html) * @package system */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * System Block @@ -51,7 +53,7 @@ public function __construct() class SystemBlockLinkModuleHandler extends XoopsPersistableObjectHandler { /** - * @param null|XoopsDatabase $db + * @param XoopsDatabase|null $db */ public function __construct(XoopsDatabase $db) { diff --git a/htdocs/modules/system/class/group.php b/htdocs/modules/system/class/group.php index 89cd31b77..bc8b99672 100644 --- a/htdocs/modules/system/class/group.php +++ b/htdocs/modules/system/class/group.php @@ -15,7 +15,9 @@ * @package system */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} include_once XOOPS_ROOT_PATH . '/kernel/group.php'; @@ -198,7 +200,7 @@ public function getForm($action = false) class SystemGroupHandler extends XoopsPersistableObjectHandler { /** - * @param null|XoopsDatabase $db + * @param XoopsDatabase|null $db */ public function __construct(XoopsDatabase $db) { diff --git a/htdocs/modules/system/class/maintenance.php b/htdocs/modules/system/class/maintenance.php index 44e1180f2..eccfe0e36 100644 --- a/htdocs/modules/system/class/maintenance.php +++ b/htdocs/modules/system/class/maintenance.php @@ -15,7 +15,9 @@ * @package system */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * System Maintenance diff --git a/htdocs/modules/system/class/menu.php b/htdocs/modules/system/class/menu.php index 7fd0c36d4..fcb184a70 100644 --- a/htdocs/modules/system/class/menu.php +++ b/htdocs/modules/system/class/menu.php @@ -15,7 +15,9 @@ * @author Andricq Nicolas (AKA MusS) */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * Class SystemMenuHandler diff --git a/htdocs/modules/system/class/smilies.php b/htdocs/modules/system/class/smilies.php index 5befbef14..18655517e 100644 --- a/htdocs/modules/system/class/smilies.php +++ b/htdocs/modules/system/class/smilies.php @@ -16,7 +16,9 @@ * @package system */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * System Smilies @@ -116,7 +118,7 @@ public function getForm($action = false) class SystemsmiliesHandler extends XoopsPersistableObjectHandler { /** - * @param null|XoopsDatabase $db + * @param XoopsDatabase|null $db */ public function __construct(XoopsDatabase $db) { diff --git a/htdocs/modules/system/class/userrank.php b/htdocs/modules/system/class/userrank.php index 13dd40ea0..99d112f30 100644 --- a/htdocs/modules/system/class/userrank.php +++ b/htdocs/modules/system/class/userrank.php @@ -15,7 +15,9 @@ * @package system */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * System User ranks @@ -122,7 +124,7 @@ public function getForm($action = false) class SystemuserrankHandler extends XoopsPersistableObjectHandler { /** - * @param null|XoopsDatabase $db + * @param XoopsDatabase|null $db */ public function __construct(XoopsDatabase $db) { diff --git a/htdocs/modules/system/class/users.php b/htdocs/modules/system/class/users.php index 2da00492b..784c4e2e0 100644 --- a/htdocs/modules/system/class/users.php +++ b/htdocs/modules/system/class/users.php @@ -13,7 +13,9 @@ * @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html) * @package system */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} include_once XOOPS_ROOT_PATH . '/kernel/user.php'; @@ -98,7 +100,7 @@ public function getForm() class SystemUsersHandler extends XoopsUserHandler { /** - * @param null|XoopsDatabase $db + * @param XoopsDatabase|null $db */ public function __construct(XoopsDatabase $db) { diff --git a/htdocs/modules/system/include/update.php b/htdocs/modules/system/include/update.php index f1e02fbdd..3e354e7a2 100644 --- a/htdocs/modules/system/include/update.php +++ b/htdocs/modules/system/include/update.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since @@ -18,8 +18,8 @@ */ /** - * @param $module - * @param null $prev_version + * @param XoopsModule $module + * @param string|null $prev_version * * @return bool|null */ @@ -43,7 +43,7 @@ function xoops_module_update_system(XoopsModule $module, $prev_version = null) // irmtfan bug fix: solve templates duplicate issue /** - * @param $module + * @param XoopsModule $module * * @return bool */ diff --git a/htdocs/modules/system/menu.php b/htdocs/modules/system/menu.php index 2868e2bf5..43cd03afd 100644 --- a/htdocs/modules/system/menu.php +++ b/htdocs/modules/system/menu.php @@ -10,14 +10,16 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since * @author XOOPS Development Team, Kazumi Ono (AKA onokazu) */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} $groups = $GLOBALS['xoopsUser']->getGroups(); $all_ok = false; diff --git a/htdocs/modules/system/preloads/core.php b/htdocs/modules/system/preloads/core.php index 5fe7fda65..fea571aa5 100644 --- a/htdocs/modules/system/preloads/core.php +++ b/htdocs/modules/system/preloads/core.php @@ -15,7 +15,9 @@ * @author Andricq Nicolas (AKA MusS) */ -// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +//if (!defined('XOOPS_ROOT_PATH')) { +// throw new \RuntimeException('XOOPS root path not defined'); +//} /** * Class SystemCorePreload diff --git a/htdocs/modules/system/xoops_version.php b/htdocs/modules/system/xoops_version.php index 0de0c530b..6d869ebc0 100644 --- a/htdocs/modules/system/xoops_version.php +++ b/htdocs/modules/system/xoops_version.php @@ -10,7 +10,7 @@ */ /** - * @copyright XOOPS Project https://xoops.org/ + * @copyright 2000-2025 XOOPS Project (https://xoops.org) * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) * @package * @since diff --git a/htdocs/themes/xbootstrap5/modules/system/system_comment.tpl b/htdocs/themes/xbootstrap5/modules/system/system_comment.tpl index 132cc493e..7fff0c394 100644 --- a/htdocs/themes/xbootstrap5/modules/system/system_comment.tpl +++ b/htdocs/themes/xbootstrap5/modules/system/system_comment.tpl @@ -32,7 +32,7 @@
-

<{$comment.image}><{$comment.title}>

+

<{$comment.image|default:''}><{$comment.title|default:''}>

<{$comment.text}>

diff --git a/htdocs/themes/xbootstrap5/theme.tpl b/htdocs/themes/xbootstrap5/theme.tpl index 3764932da..b9d644479 100644 --- a/htdocs/themes/xbootstrap5/theme.tpl +++ b/htdocs/themes/xbootstrap5/theme.tpl @@ -44,23 +44,6 @@ - - - - - - - - - <{**}> - - - - - - -<{* *}> - <{if isset($xoops_dirname) && $xoops_dirname == "system"}><{$xoops_sitename}><{if !empty($xoops_pagetitle)}> - <{$xoops_pagetitle}><{/if}><{else}><{if !empty($xoops_pagetitle)}><{$xoops_pagetitle}> - <{$xoops_sitename}><{/if}><{/if}> @@ -110,6 +93,34 @@ + + +<{*============================= JS ==================================*}> + + + + + +<{**}> + + + + + + + + + + + + + + + + +<{$xoops_module_header}> + +