osclass / Osclass

With Osclass, get your own classifieds site for free. Build your own Osclass installation and start advertising real estate, jobs or whatever you want- in minutes!
http://osclass.org/
648 stars 344 forks source link

PHP Warning: A non-numeric value(s) #2266

Closed dev-101 closed 6 years ago

dev-101 commented 6 years ago

In PHP 7.2+ this raises a warning:

\oc-admin\themes\modern\functions.php

function check_version_admin_footer() {
    if( (time() - osc_last_version_check()) > (24 * 3600) ) {

We need to cast return values as integers to avoid it.

dev-101 commented 6 years ago

osc_last_version_check osc_themes_last_version_check osc_plugins_last_version_check osc_languages_last_version_check

Above helpers should return integers, as time() returns integer as well.

Just a "fun fact" - Osclass version is stored as INTEGER in database, while all other 3 values as STRING. Not that it matters much, though. They should still be casted as int's.