Osclass 3.9 and PHP...
 
Notifications
Clear all

Osclass 3.9 and PHP 7.4

18 Posts
6 Users
3 Reactions
666 Views
(@asaga)
Posts: 31
Trusted Member
Topic starter
 

Hello.

Doing some updates and maintenance, i tried to use PHP 7.4 with 3.9.

And i see several (a lot actually) issues.

Has anyone tried to fix them?

Thanks

 
Posted : February 18, 2021 18:43
Johannes de Sacrobosco
(@johannes-de-sacrobosco)
Posts: 83
Member Moderator
 

Well the developer of Osclass 3.9 did a HUGE mistake not releasing some 3.9.x version with all updates and small scale fixes for 3.9.

Instead he moved on with 5 beta, with ZERO backwards compatibility. And now he also is missing for months ......

Practically SELF-DESTROYED. Now people have moved to other releases.

In any case, please in your posts, provide the issues details from the logs or any other detailed information you may have.

Otherwise we can't help.

 
Posted : February 18, 2021 18:53
(@asaga)
Posts: 31
Trusted Member
Topic starter
 

There are actually 2 about magic quotes depreciated, one syntax error from htmlpurifier and a few others.

[18-Feb-2021 15:35:43 Europe/London] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/oc-includes/osclass/core/Params.php on line 134

[18-Feb-2021 15:35:43 Europe/London] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/oc-includes/osclass/core/Params.php on line 134

[18-Feb-2021 15:35:43 Europe/London] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/oc-includes/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php on line 162

[18-Feb-2021 15:35:43 Europe/London] PHP Notice: Trying to access array offset on value of type bool in /home/oc-includes/osclass/helpers/hPage.php on line 227

[18-Feb-2021 15:35:58 Europe/London] PHP Notice: Trying to access array offset on value of type null in /home/oc-includes/osclass/frm/Category.form.class.php on line 47

[18-Feb-2021 15:35:58 Europe/London] PHP Notice: Trying to access array offset on value of type null in /home/oc-includes/osclass/frm/Category.form.class.php on line 69

 
Posted : February 18, 2021 19:08
Johannes de Sacrobosco
(@johannes-de-sacrobosco)
Posts: 83
Member Moderator
 

This (and similar issue in the core)

[18-Feb-2021 15:35:43 Europe/London] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/oc-includes/osclass/core/Params.php on line 134

can be easily be fixed. Find are remove carefully from params.php (two instances):

if(get_magic_quotes_gpc()) {
$value = strip_slashes_extended($value);
}

It seems the "magic quotes" exist in other files also. Do the same.

 

 
Posted : February 18, 2021 19:20
Asaga reacted
Johannes de Sacrobosco
(@johannes-de-sacrobosco)
Posts: 83
Member Moderator
 

This:

[18-Feb-2021 15:35:43 Europe/London] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/oc-includes/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php on line 162

can be also easily be fixed.

Replace line 162

$in = ord($str{$i});

with

$in = ord($str[$i]);
 
Posted : February 18, 2021 19:22
Asaga reacted
Johannes de Sacrobosco
(@johannes-de-sacrobosco)
Posts: 83
Member Moderator
 

The rest 3 notices you posted are new to me and i will try to debug more and update if i find a solution.

 

 
Posted : February 18, 2021 19:23
Johannes de Sacrobosco
(@johannes-de-sacrobosco)
Posts: 83
Member Moderator
 

[18-Feb-2021 15:35:43 Europe/London] PHP Notice: Trying to access array offset on value of type bool in /home/oc-includes/osclass/helpers/hPage.php on line 227

The code is:

    function osc_has_static_pages() {
        if ( !View::newInstance()->_exists('pages') ) {
            View::newInstance()->_exportVariableToView('pages', Page::newInstance()->listAll(false, 1) );
        }

        $page = View::newInstance()->_next('pages');
        View::newInstance()->_exportVariableToView('page_meta', json_decode($page['s_meta'], true));
        return $page;
    }

and the line in error is:

View::newInstance()->_exportVariableToView('page_meta', json_decode($page['s_meta'], true));

 

So change the whole function with:

 

function osc_has_static_pages()
{
    if (!View::newInstance()->_exists('pages')) {
        View::newInstance()->_exportVariableToView('pages', Page::newInstance()->listAll(false, 1));
    }
    if (View::newInstance()->_get('pageLoop') !== 'pages') {
        View::newInstance()->_exportVariableToView('oldPage', View::newInstance()->_get('page'));
        View::newInstance()->_exportVariableToView('pageLoop', 'pages');
    }
    $page = View::newInstance()->_next('pages');
    if (!$page) {
        View::newInstance()->_exportVariableToView('page', View::newInstance()->_get('oldPage'));
        View::newInstance()->_exportVariableToView('pageLoop', '');
    } else {
        View::newInstance()->_exportVariableToView('page', View::newInstance()->_current('pages'));
    }
    if (isset($page['s_meta'])) {
        View::newInstance()->_exportVariableToView('page_meta', json_decode($page['s_meta'], true));
    }

    return $page;
}
 
Posted : February 18, 2021 19:39
Asaga reacted
Page 1 / 3