CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#12543] lib/ files corrections

avatar
Created By: Philippe Thomas (filto)
Date Submitted: Mon Apr 18 22:22:26 -0400 2022

Assigned To:
Version: None
CMSMS Version: 2.2.16
Severity: Minor
Resolution: Fixed
State: Open
Summary:
lib/ files corrections
Detailed Description:
core : /lib/classes/

-----------------------------------------------
lib/classes/class.cms_content_tree.php

L258 : in function getContent : getParent() deprecated name function : since
cmsms 2.0 get_parent()

$parent = $this->getParent();

/* --- replace by (minuscules)---- */
$parent = $this->get_parent();

------------------------------------------
lib/classes/class.cms_url.php

L258 must return a string and replace count by is_countable
if( count($this->_query) ) return http_build_query($this->_query);
/* --- replace by
if(is_countable($this->_query)) return http_build_query($this->_query);
return '';
------------------------------------------
lib/classes/class.cms_userprefs.php

L 105 wrong syntax

* @return strung 

#--- correction

* @return string

------------------------------------------

/lib/classes/class.moduleoperations.inc.php

L 932 : $alerts could be null, so replace count($alerts) by
is_countable($alerts)
(php7.x if the parameter was neither an array nor Countable interface, 1 would
be returned..
....and from php8.0.0 will now throw TypeError )

L932 // note : count is already executed by function load_all(); 

$alerts = \CMSMS\AdminAlerts\Alert::load_all(); 
                if( count($alerts) ) {

/* --- replace by ---- */

$alerts = \CMSMS\AdminAlerts\Alert::load_all();
                if( is_countable($alerts)) {


##########################################
core : /lib/

------------------------------------------
/lib/compat.functions.php

L29 no error but just make sure it will not in futur php versions....

if( !function_exists('gzopen') ) {

/* --- replace by ---- */

if (!function_exists('gzopen') && function_exists('gzopen64')) {

-------------------------------
/lib/test.functions.php

function testSupportedDatabase() :

L176 wrong type

* @param string  $db

/* --- replace by ---- */

* @param object $db


L 179
function & testSupportedDatabase( 
/* --- replace by ---- */
function &testSupportedDatabase(

----
L562 : in function testVersionRange : undefined $lang_fn

$test = new CmsInstallTest();
$test->title = $title;

/* --- add global $lang_fn; use in line 577 ---- */
$test = new CmsInstallTest();
$test->title = $title;
global $lang_fn;

----
L1394 in function testFileUploads : undefined function $sortfn()
if(is_array($_FILES["$inputname"]['name'])) $_files =
$sortfn($_FILES["$inputname"]);

no information to know what is expected, but it could be function $fn defined in
line 1366... but used nowhere !
but it is never executed cause
L 1387 : if(! isset($_FILES["$inputname"])) // not defined so always return
$test !

dont know how to solve it....;


History

Comments
avatar
Date: 2022-04-19 13:14
Posted By: Fernando Morgado (JoMorg)

Fixed in SVN, thanks
      
Updates

Updated: 2022-04-19 13:14
resolution_id: => 7