Skip to content

Commit

Permalink
Merge 23-03-2023 Version XCL 2.3.3 RC PHP8
Browse files Browse the repository at this point in the history
  • Loading branch information
gigamaster committed Mar 23, 2023
1 parent 7bb4306 commit 9760842
Show file tree
Hide file tree
Showing 106 changed files with 454 additions and 427 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ All notable changes to this project will be documented in this file.

Refer please to repository Legacy Commits

## [2.3.3 rc PHP8] 2023-03-23

Merge backend, frontend and branch PHP8

## [2.3.1rc] 2023-03-02

### Added
Expand Down
4 changes: 1 addition & 3 deletions html/class/errorhandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @package kernel
* @subpackage core
* @version XCL 2.3.3
* @author Nobuhiro YASUTOMI, PHP8
* @author Other authors gigamaster, 2020 XCL/PHP7
* @author Other authors nobunobu, 2007/06/24
* @author Michael van Dam
Expand Down Expand Up @@ -144,9 +145,6 @@ public function renderErrors()
case E_USER_DEPRECATED:
$out = 'Deprecated [Xoops]: ';
break;
case E_USER_STRICT:
$out = 'Strict [Xoops]: ';
break;
case E_NOTICE:
$out = 'Notice [PHP]: ';
break;
Expand Down
4 changes: 0 additions & 4 deletions html/class/pagenav.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ public function __construct($total_items, $items_perpage, $current_start, $start
}
$this->url = xoops_getenv('PHP_SELF').'?'.$extra_arg.trim($start_name).'=';
}
public function XoopsPageNav($total_items, $items_perpage, $current_start, $start_name= 'start', $extra_arg= '')
{
return $this->__construct($total_items, $items_perpage, $current_start, $start_name, $extra_arg);
}

/**
* Create text navigation
Expand Down
7 changes: 2 additions & 5 deletions html/class/xoopsform/formdhtmltextarea.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @package kernel
* @subpackage form
* @version XCL 2.3.3
* @author Nobuhiro YASUTOMI, PHP8
* @author Other authors gigamaster, 2020 XCL/PHP7
* @author Other authors Minahito, 2007/05/15
* @author Kazumi Ono (aka onokazu)
Expand All @@ -29,7 +30,7 @@ class XoopsFormDhtmlTextArea extends XoopsFormTextArea
* @var string
* @access private
*/
public $_hiddenText;
public $_xoopsHiddenText;

/**
* Editor type
Expand Down Expand Up @@ -61,10 +62,6 @@ public function __construct($caption, $name, $value, $rows=5, $cols=50, $hiddent
parent::__construct($caption, $name, $value, $rows, $cols);
$this->_xoopsHiddenText = $hiddentext;
}
public function XoopsFormDhtmlTextArea($caption, $name, $value, $rows=5, $cols=50, $hiddentext= 'xoopsHiddenText')
{
return self::__construct($caption, $name, $value, $rows, $cols, $hiddentext);
}

/**
* Prepare HTML for output
Expand Down
4 changes: 0 additions & 4 deletions html/class/xoopsform/formselect.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ public function __construct($caption, $name, $value=null, $size=1, $multiple=fal
$this->setValue($value);
}
}
public function XoopsFormSelect($caption, $name, $value=null, $size=1, $multiple=false)
{
return $this->__construct($caption, $name, $value, $size, $multiple);
}

/**
* Are multiple selections allowed?
Expand Down
6 changes: 1 addition & 5 deletions html/class/xoopsform/formselectlang.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ class XoopsFormSelectLang extends XoopsFormSelect
*/
public function __construct($caption, $name, $value=null, $size=1)
{
$this->XoopsFormSelect($caption, $name, $value, $size);
parent::__construct($caption, $name, $value, $size);
$this->addOptionArray(XoopsLists::getLangList());
}
public function XoopsFormSelectLang($caption, $name, $value=null, $size=1)
{
return $this->__construct($caption, $name, $value, $size);
}
}
6 changes: 1 addition & 5 deletions html/class/xoopsform/formselecttimezone.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ class XoopsFormSelectTimezone extends XoopsFormSelect
*/
public function __construct($caption, $name, $value=null, $size=1)
{
$this->XoopsFormSelect($caption, $name, $value, $size);
parent::__construct($caption, $name, $value, $size);
$this->addOptionArray(XoopsLists::getTimeZoneList());
}
public function XoopsFormSelectTimezone($caption, $name, $value=null, $size=1)
{
return $this->__construct($caption, $name, $value, $size);
}
}
2 changes: 1 addition & 1 deletion html/core/XCube_ActionForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ public static function &factoryClass(string $dependName ) {
$_cache[ $dependName ] = new $class_name();
} else {
// FIXME:: use delegate?
die( "This is an error message of Alpha or Beta series. ${dependName} Validator is not found." );
die( "This is an error message of Alpha or Beta series. {$dependName} Validator is not found." );
}
}

Expand Down
3 changes: 2 additions & 1 deletion html/core/XCube_FormFile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* /core/XCube_FormFile.class.php
* @package XCube
* @version XCL 2.3.3
* @author Nobuhiro YASUTOMI, PHP8
* @author Other authors gigamaster, 2020 XCL/PHP7
* @author Minahito, 2008/10/12
* @copyright (c) 2005-2023 The XOOPSCube Project
Expand Down Expand Up @@ -119,7 +120,7 @@ public function getExtension() {
public function setExtension( $ext ) {
$filename = $this->getFileName();
if ( preg_match( "/(.+)\.\w+$/", $filename, $match ) ) {
$this->setFileName( $match[1] . ".${ext}" );
$this->setFileName( $match[1] . ".{$ext}" );
}
}

Expand Down
3 changes: 2 additions & 1 deletion html/core/XCube_Root.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* /core/XCube_Root.class.php
* @package XCube
* @version XCL 2.3.3
* @author Nobuhiro YASUTOMI, PHP8
* @author Other authors gigamaster, 2020 XCL/PHP7
* @author Minahito, 2008/11/20
* @copyright (c) 2005-2023 The XOOPSCube Project
Expand All @@ -21,7 +22,7 @@

if ( PHP_VERSION_ID >= 50000 ) {
function XC_CLASS_EXISTS( $className ) {
return class_exists( $className, false );
return $className && class_exists( $className, false );
}
} else {
function XC_CLASS_EXISTS( $className ) {
Expand Down
3 changes: 2 additions & 1 deletion html/core/XCube_Service.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* /core/XCube_Service.class.php
* @package XCube
* @version XCL 2.3.3
* @author Nobuhiro YASUTOMI, PHP8
* @author Other authors gigamaster, 2020 XCL/PHP7
* @author Minahito, 2008/10/12
* @copyright (c) 2005-2023 The XOOPSCube Project
Expand Down Expand Up @@ -182,7 +183,7 @@ public function call( $operation, $params ) {
return $ret;
}

$this->mClientErrorStr = "operation ${operation} not present.";
$this->mClientErrorStr = "operation {$operation} not present.";

return null;
}
Expand Down
3 changes: 2 additions & 1 deletion html/include/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @package XCL
* @subpackage core
* @version XCL 2.3.3
* @author Nobuhiro YASUTOMI, PHP8
* @author Other authors gigamaster, 2020 XCL PHP7
* @author Other authors Mumincacao, 2008/10/03
* @author Community
Expand Down Expand Up @@ -495,7 +496,7 @@ function xoops_getenv($key)
case 'PHP_SELF':
case 'PATH_INFO':
case 'PATH_TRANSLATED':
$ret = htmlspecialchars($ret, ENT_QUOTES);
if ($ret) $ret = htmlspecialchars($ret, ENT_QUOTES);
break;
}

Expand Down
35 changes: 18 additions & 17 deletions html/install/include/makedata.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @package XCL
* @subpackage Installation Wizard
* @version XCL 2.3.3
* @author Nobuhiro YASUTOMI, PHP8
* @author Other authors gigamaster, 2020 XCL/PHP7
* @author Other authors Minahito, 2007/05/15
* @author
Expand Down Expand Up @@ -128,15 +129,15 @@ function make_data( &$dbm, &$cm, $adminname, $adminpass, $adminmail, $language,
* @param $groups
*/
function installModule( &$dbm, $mid, $module, $module_name, $language = 'english', &$groups ) {
if ( file_exists( "../modules/${module}/language/${language}/modinfo.php" ) ) {
include "../modules/${module}/language/${language}/modinfo.php";
if ( file_exists( "../modules/{$module}/language/{$language}/modinfo.php" ) ) {
include "../modules/{$module}/language/{$language}/modinfo.php";
} else {
include "../modules/${module}/language/english/modinfo.php";
include "../modules/{$module}/language/english/modinfo.php";
$language = 'english';
}

$modversion = [];
require_once "../modules/${module}/xoops_version.php";
require_once "../modules/{$module}/xoops_version.php";
$time = time();

// RMV-NOTIFY (updated for extra column in table)
Expand All @@ -148,23 +149,23 @@ function installModule( &$dbm, $mid, $module, $module_name, $language = 'english
if ( isset( $modversion['hasMain'] ) && ( 1 === $modversion['hasMain'] ) ) {
$hasmain = 1;
}
$dbm->insert( 'modules', " VALUES (${mid}, '" . constant( $module_name ) . "', 100, " . $time . ", 0, 1, '${module}', ${hasmain}, 1, 0, ${hasconfig}, 0, 0)" );
$dbm->insert( 'modules', " VALUES ({$mid}, '" . constant( $module_name ) . "', 100, " . $time . ", 0, 1, '{$module}', {$hasmain}, 1, 0, {$hasconfig}, 0, 0)" );

//
// Database
// TODO Dependence on mysql, Now.
//
if ( isset( $modversion['sqlfile']['mysql'] ) ) {
$dbm->queryFromFile( "../modules/${module}/" . $modversion['sqlfile']['mysql'] );
$dbm->queryFromFile( "../modules/{$module}/" . $modversion['sqlfile']['mysql'] );
}

if ( is_array( $modversion['templates'] ) && count( $modversion['templates'] ) > 0 ) {
foreach ( $modversion['templates'] as $tplfile ) {
if ( $fp = fopen( "../modules/${module}/templates/" . $tplfile['file'], 'r' ) ) {
$newtplid = $dbm->insert( 'tplfile', " VALUES (0, ${mid}, '${module}', 'default', '" . addslashes( $tplfile['file'] ) . "', '" . addslashes( $tplfile['description'] ) . "', " . $time . ', ' . $time . ", 'module')" );
if ( $fp = fopen( "../modules/{$module}/templates/" . $tplfile['file'], 'r' ) ) {
$newtplid = $dbm->insert( 'tplfile', " VALUES (0, {$mid}, '{$module}', 'default', '" . addslashes( $tplfile['file'] ) . "', '" . addslashes( $tplfile['description'] ) . "', " . $time . ', ' . $time . ", 'module')" );
//$newtplid = $xoopsDB->getInsertId();
if ( filesize( "../modules/${module}/templates/" . $tplfile['file'] ) > 0 ) {
$tplsource = fread( $fp, filesize( "../modules/${module}/templates/" . $tplfile['file'] ) );
if ( filesize( "../modules/{$module}/templates/" . $tplfile['file'] ) > 0 ) {
$tplsource = fread( $fp, filesize( "../modules/{$module}/templates/" . $tplfile['file'] ) );
} else {
$tplsource = '';
}
Expand All @@ -176,7 +177,7 @@ function installModule( &$dbm, $mid, $module, $module_name, $language = 'english

if ( is_array( $modversion['blocks'] ) && count( $modversion['blocks'] ) > 0 ) {
foreach ( $modversion['blocks'] as $func_num => $newblock ) {
if ( $fp = fopen( '../modules/${module}/templates/blocks/' . $newblock['template'], 'rb' ) ) {
if ( $fp = fopen( '../modules/{$module}/templates/blocks/' . $newblock['template'], 'rb' ) ) {
//
// The following checking is dependence on the structure of system module.
//
Expand All @@ -191,13 +192,13 @@ function installModule( &$dbm, $mid, $module, $module_name, $language = 'english
}
$options = ! isset( $newblock['options'] ) ? '' : trim( $newblock['options'] );
$edit_func = ! isset( $newblock['edit_func'] ) ? '' : trim( $newblock['edit_func'] );
$newbid = $dbm->insert( 'newblocks', " VALUES (0, ${mid}, " . $func_num . ", '" . addslashes( $options ) . "', '" . addslashes( $newblock['name'] ) . "', '" . addslashes( $newblock['name'] ) . "', '', 0, 0, " . $visible . ", 'S', 'H', 1, '${module}', '" . addslashes( $newblock['file'] ) . "', '" . addslashes( $newblock['show_func'] ) . "', '" . addslashes( $edit_func ) . "', '" . addslashes( $newblock['template'] ) . "', 0, " . $time . ')'
$newbid = $dbm->insert( 'newblocks', " VALUES (0, {$mid}, " . $func_num . ", '" . addslashes( $options ) . "', '" . addslashes( $newblock['name'] ) . "', '" . addslashes( $newblock['name'] ) . "', '', 0, 0, " . $visible . ", 'S', 'H', 1, '{$module}', '" . addslashes( $newblock['file'] ) . "', '" . addslashes( $newblock['show_func'] ) . "', '" . addslashes( $edit_func ) . "', '" . addslashes( $newblock['template'] ) . "', 0, " . $time . ')'
);
//$newbid = $xoopsDB->getInsertId();
$newtplid = $dbm->insert( 'tplfile', ' VALUES (0, ' . $newbid . ", '${module}', 'default', '" . addslashes( $newblock['template'] ) . "', '" . addslashes( $newblock['description'] ) . "', " . $time . ', ' . $time . ", 'block')" );
$newtplid = $dbm->insert( 'tplfile', ' VALUES (0, ' . $newbid . ", '{$module}', 'default', '" . addslashes( $newblock['template'] ) . "', '" . addslashes( $newblock['description'] ) . "', " . $time . ', ' . $time . ", 'block')" );
//$newtplid = $xoopsDB->getInsertId();
if ( filesize( "../modules/${module}/templates/blocks/" . $newblock['template'] ) > 0 ) {
$tplsource = fread( $fp, filesize( "../modules/${module}/templates/blocks/" . $newblock['template'] ) );
if ( filesize( "../modules/{$module}/templates/blocks/" . $newblock['template'] ) > 0 ) {
$tplsource = fread( $fp, filesize( "../modules/{$module}/templates/blocks/" . $newblock['template'] ) );
} else {
$tplsource = '';
}
Expand Down Expand Up @@ -232,11 +233,11 @@ function installModule( &$dbm, $mid, $module, $module_name, $language = 'english
$default = serialize( explode( '|', trim( $default ) ) );
}

$conf_id = $dbm->insert( 'config', " VALUES (0, ${mid}, 0, '${name}', '${title}', '${default}', '${desc}', '${formtype}', '${valuetype}', ${count})" );
$conf_id = $dbm->insert( 'config', " VALUES (0, {$mid}, 0, '{$name}', '{$title}', '{$default}', '{$desc}', '{$formtype}', '{$valuetype}', {$count})" );

if ( isset( $configInfo['options'] ) && is_array( $configInfo['options'] ) ) {
foreach ( $configInfo['options'] as $key => $value ) {
$dbm->insert( 'configoption', " VALUES (0, '${key}', '${value}', ${conf_id})" );
$dbm->insert( 'configoption', " VALUES (0, '{$key}', '{$value}', {$conf_id})" );
}
}

Expand Down
4 changes: 2 additions & 2 deletions html/install/language/ja_utf8/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@
const _INSTALL_L81 = 'アクセス権のチェック' ;
const _INSTALL_L82 = 'ファイルのアクセス権のチェック' ;
const _INSTALL_L83 = 'ファイル%sは、書込不可となっています。chmod 666してください。 %s' ;
const _INSTALL_L84 = 'ファイル%sは、書込可です。 %s' ;
const _INSTALL_L84 = 'ファイル%sは、書込可です。' ;
const _INSTALL_L85 = 'ディレクトリ%sは、書込不可となっています。chmod 777してください。 %s' ;
const _INSTALL_L86 = 'ディレクトリ%sは、書込可です。 %s' ;
const _INSTALL_L86 = 'ディレクトリ%sは、書込可です。' ;
const _INSTALL_L87 = 'アクセス権に問題はありません。' ;
const _INSTALL_L88 = 'ファイル・ディレクトリのアクセス権をチェックしてください。' ;
const _INSTALL_L166 = 'XOOPS_TRUST_PATH のアクセス権チェック' ;
Expand Down
9 changes: 5 additions & 4 deletions html/kernel/group.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* group of users
* @package kernel
* @version XCL 2.3.3
* @author Nobuhiro YASUTOMI, PHP8
* @author Other authors gigamaster, 2020 XCL/PHP7
* @author Other authors Minahito, 2007/05/15
* @author Kazumi Ono (aka onokazu)
Expand Down Expand Up @@ -455,10 +456,10 @@ public function &getUsersByNoGroup($groupid, $limit=0, $start=0)
$usersTable = $db->prefix('users');
$linkTable = $db->prefix('groups_users_link');

$sql = "SELECT u.uid FROM ${usersTable} u LEFT JOIN ${linkTable} g ON u.uid=g.uid," .
"${usersTable} u2 LEFT JOIN ${linkTable} g2 ON u2.uid=g2.uid AND g2.groupid=${groupid} " .
"WHERE (g.groupid != ${groupid} OR g.groupid IS NULL) " .
"AND (g2.groupid = ${groupid} OR g2.groupid IS NULL) " . 'AND u.uid = u2.uid AND g2.uid IS NULL GROUP BY u.uid';
$sql = "SELECT u.uid FROM {$usersTable} u LEFT JOIN {$linkTable} g ON u.uid=g.uid," .
"{$usersTable} u2 LEFT JOIN {$linkTable} g2 ON u2.uid=g2.uid AND g2.groupid={$groupid} " .
"WHERE (g.groupid != {$groupid} OR g.groupid IS NULL) " .
"AND (g2.groupid = {$groupid} OR g2.groupid IS NULL) " . 'AND u.uid = u2.uid AND g2.uid IS NULL GROUP BY u.uid';

$result = $db->query($sql, $limit, $start);
if (!$result) {
Expand Down
9 changes: 5 additions & 4 deletions html/kernel/member.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* membership data
* @package kernel
* @version XCL 2.3.3
* @author Nobuhiro YASUTOMI, PHP8
* @author Other authors gigamaster, 2020 XCL/PHP7
* @author Other authors Minahito, 2007/05/15
* @author Kazumi Ono (aka onokazu)
Expand Down Expand Up @@ -460,10 +461,10 @@ public function getUserCountByNoGroup($group_id)
$usersTable = $this->_mHandler->db->prefix('users');
$linkTable = $this->_mHandler->db->prefix('groups_users_link');

$sql = "SELECT count(*) FROM ${usersTable} u LEFT JOIN ${linkTable} g ON u.uid=g.uid," .
"${usersTable} u2 LEFT JOIN ${linkTable} g2 ON u2.uid=g2.uid AND g2.groupid=${groupid} " .
"WHERE (g.groupid != ${groupid} OR g.groupid IS NULL) " .
"AND (g2.groupid = ${groupid} OR g2.groupid IS NULL) " . 'AND u.uid = u2.uid AND g2.uid IS NULL GROUP BY u.uid';
$sql = "SELECT count(*) FROM {$usersTable} u LEFT JOIN {$linkTable} g ON u.uid=g.uid," .
"{$usersTable} u2 LEFT JOIN {$linkTable} g2 ON u2.uid=g2.uid AND g2.groupid={$groupid} " .
"WHERE (g.groupid != {$groupid} OR g.groupid IS NULL) " .
"AND (g2.groupid = {$groupid} OR g2.groupid IS NULL) " . 'AND u.uid = u2.uid AND g2.uid IS NULL GROUP BY u.uid';

$result = $this->_mHandler->db->query($sql);
if (!$result) {
Expand Down
6 changes: 3 additions & 3 deletions html/modules/legacy/admin/actions/ActSearchAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ public function prepare(&$controller, &$xoopsUser)
$perm = $db->prefix('group_permission');
$groups = implode(',', $xoopsUser->getGroups());

$sql = "SELECT DISTINCT ${mod}.weight, ${mod}.mid FROM ${mod},${perm} " .
"WHERE ${mod}.isactive=1 AND ${mod}.mid=${perm}.gperm_itemid AND ${perm}.gperm_name='module_admin' AND ${perm}.gperm_groupid IN (${groups}) " .
"ORDER BY ${mod}.weight, ${mod}.mid";
$sql = "SELECT DISTINCT {$mod}.weight, {$mod}.mid FROM {$mod},{$perm} " .
"WHERE {$mod}.isactive=1 AND {$mod}.mid={$perm}.gperm_itemid AND {$perm}.gperm_name='module_admin' AND {$perm}.gperm_groupid IN ({$groups}) " .
"ORDER BY {$mod}.weight, {$mod}.mid";

$result=$db->query($sql);

Expand Down
9 changes: 5 additions & 4 deletions html/modules/legacy/admin/actions/HelpAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* HelpAction.class.php
* @package Legacy
* @version XCL 2.3.3
* @author Nobuhiro YASUTOMI, PHP8
* @author Other authors gigamaster, 2020 XCL/PHP7
* @author Kilica, 2008/09/25
* @copyright (c) 2005-2023 The XOOPSCube Project
Expand Down Expand Up @@ -104,7 +105,7 @@ function Legacy_modifier_helpurl($file, $dirname = null)
// TODO We should check file_exists.
//

$url = XOOPS_MODULE_URL . "/legacy/admin/index.php?action=Help&dirname=${dirname}&file=${file}";
$url = XOOPS_MODULE_URL . "/legacy/admin/index.php?action=Help&dirname={$dirname}&file={$file}";

return $url;
}
Expand All @@ -120,9 +121,9 @@ function Legacy_modifier_helpimage($file)
$language = $root->mContext->getXoopsConfig('language');
$dirname = $root->mContext->getAttribute('legacy_help_dirname');

$path = "/${dirname}/language/${language}/help/images/${file}";
$path = "/{$dirname}/language/{$language}/help/images/{$file}";
if (!file_exists(XOOPS_MODULE_PATH . $path) && 'english' !== $language) {
$path = "/${dirname}/language/english/help/images/${file}";
$path = "/{$dirname}/language/english/help/images/{$file}";
}

return XOOPS_MODULE_URL . $path;
Expand Down Expand Up @@ -200,7 +201,7 @@ public function getDefaultView(&$controller, &$xoopsUser)
//
// TODO We should not access files in language directory directly.
//
$template_dir = XOOPS_MODULE_PATH . '/' . $this->_mDirname . "/language/${language}/help";
$template_dir = XOOPS_MODULE_PATH . '/' . $this->_mDirname . "/language/{$language}/help";
if (!file_exists($template_dir . '/' . $helpfile)) {
$template_dir = XOOPS_MODULE_PATH . '/' . $this->_mDirname . '/language/english/help';
if (!file_exists($template_dir . '/' . $helpfile)) {
Expand Down
Loading

0 comments on commit 9760842

Please sign in to comment.