We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Running php 7.4.8 | Forum

dave Team
dave Jul 30

Here are the first issues i have found when running oxwall on php 7.4.8, there may be more to come. 


One of these is easy to fix just removing the call to the function... But the others ill have to check the manuals and update this topic later.  I will also check github to see if someone has already addressed these.


[ow_core_log] [Notice] Message: Function get_magic_quotes_gpc() is deprecated File: /home/username/public_html/sitefolder/ow_core/request.php Line:48


[ow_core_log] [Notice] Message: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` File: /home/username/public_html/sitefolder/ow_plugins/newsfeed/classes/event_handler.php Line:1444


[w_core_log] [Notice] Message: Array and string offset access syntax with curly braces is deprecated File: /home/username/public_html/sitefolder/ow_libraries/jevix/jevix.class.php Line:1025



Also just a heads up to other developers.  I suppose this means that to get our plugins ready for php 7.4 we will have to replace all


$whatever = array();

$whatever = [];


If that is true then its a HUGE undertaking to get oxwall itself ready...




dave Team
dave Jul 31

The first one we just need to remove the lines of code that reference get_magic_quotes_gpc().... at the top of the file easy peasy like so:


       /* DEPRECATED
        if ( get_magic_quotes_gpc() )
        {
            $_GET = $this->stripSlashesRecursive($_GET);
            $_POST = $this->stripSlashesRecursive($_POST);
        }
        */



==========================

the second one  deals with setting a priority for execution when using long php ternary commands...  so in this case (if i am correct) we just have to sort this out. The objective is to use parenthesese to let the server know what we want to execute first and so on..


So in this case:


Original code:

 $status = empty($actionData['data']['status'])
            ? $actionData['string']
            : empty($actionData['data']['status']) ? null : $actionData['data']['status'];


New code (untested)


$status = (empty($actionData['data']['status'])
            ? $actionData['string']
            : empty($actionData['data']['status'])) ? null : $actionData['data']['status'];


So we want to execute this part first - here is a breakdown


(empty($actionData['data']['status']) ? $actionData['string'] : empty($actionData['data']['status']))


notice i added the parenthesese in the first and last position


then we can execute the rest of the long ternary


? null : $actionData['data']['status'];



=======================


And the last one has to do with using {} to pull individual characters from a string in the jevix class.  You can no longer use {}, you have to change them to []


for example: 


original code

return ($h & 0x0F) << 18 | (ord($c{1}) & 0x3F) << 12 | (ord($c{2}) & 0x3F) << 6 | (ord($c{3}) & 0x3F);


we would just replace {number} with [number] like so


new code

return ($h & 0x0F) << 18 | (ord($c[1]) & 0x3F) << 12 | (ord($c[2]) & 0x3F) << 6 | (ord($c[3]) & 0x3F);


patricia, SD, artmedia,  does this look about right, i think i got it...

The Forum post is edited by dave Jul 31
dave Team
dave Jul 31

Here is another concern, jevix is no longer being developed (youll have to translate the site to read it)


https://code.google.com/archive/p/jevix/


so there is no update for it.  So it would have to be edited and if we are lucky it will work. Or we may have to find a new html filter script to use.



The Forum post is edited by dave Jul 31
Paul
Paul Jul 31
I´ve tried to recode this for php 7.4 month ago and the last part was the reason, I´ve given up. 
Nice too see some your work on this
The Forum post is edited by Paul Jul 31
dave Team
dave Jul 31

The first two corrections are tested and seem to work fine. The last one i am still working on.


here is the jevix changed code... it did not blow up on me so thats good... :) 


its the last function in the file


function uniord( $c )
{
    $h = ord($c[0]);
   
    if ( $h <= 0x7F )
    {
        return $h;
    }
    else if ( $h < 0xC2 )
    {
        return false;
    }
    else if ( $h <= 0xDF )
    {
        return ($h & 0x1F) << 6 | (ord($c[1]) & 0x3F);
    }
    else if ( $h <= 0xEF )
    {
        return ($h & 0x0F) << 12 | (ord($c[1]) & 0x3F) << 6 | (ord($c[2]) & 0x3F);
    }
    else if ( $h <= 0xF4 )
    {
        return ($h & 0x0F) << 18 | (ord($c[1]) & 0x3F) << 12 | (ord($c[2]) & 0x3F) << 6 | (ord($c[3]) & 0x3F);
    }
    else
    {
        return false;
    }
}




The Forum post is edited by dave Jul 31
OW-Ghost
OW-Ghost Aug 11
Can you please make rules that new plugins add to the store need follow php 7.4 standard.


If i for example add a android app i need follow googles new standard if not they will reject my app. And they standard changes every year.


I not sure what rules you have about php and plugins that they submit to store year 2020 where we have now php 7.4 available ?


If there is no rules theer should bee, it is like developers working with old languages and that is not good at all.


Like a refuse speak new words because i learned old words already and not need learn new words. It is a school thing. Tell you student learn new words and you need bee hard teach you student new words if not they will give you old language and old words back


For me you are the teacher and they need follow the teacher or have the projects rejected to they pass school teachers test

The Forum post is edited by OW-Ghost Aug 11
dave Team
dave Aug 11
That is a great idea Ghost but we really cant make it manditory until oxwall gets updated itself.  Then we can have php rules.
OW-Ghost
OW-Ghost Aug 11
we can not put new tires because the car is old.....okey i got it....what happen if you do that the car will bee broken? hmmmmmmmm.........if there was a logical reason behind your answer i would buy it...but there is no logical reason at all for prevent half software prepared for the future....even the github version is support 7.3 at least my oxwall/skalfa version do that include skalfa plugins


anyways...you the boss ...keep the old 5.6 forever to it sinks to bottom...im out from the discussion you would not agree with me even payed you 10000000000000 usd ....so fine do what you want....i will ask developers who created the plugin if they support php version 7.4 if not i will not buy 


i take action on my own and recommend others do that to...support future ...i will never again buy a plugin that support only php 5.6 ....hope other will follow me so things will bee better

The Forum post is edited by OW-Ghost Aug 11
dave Team
dave Aug 11

wow you are so aggressive for no reason.  All i said is that when oxwall is updated we can then require more current versions for the plugins as well.   I did not shoot down your idea, we just have to wait.