Code Monkey home page Code Monkey logo

Comments (4)

jdarwood007 avatar jdarwood007 commented on September 23, 2024

I can't reproduce this.

from smf.

jdarwood007 avatar jdarwood007 commented on September 23, 2024

Screen Shot 2023-03-16 at 6 44 37 PM

Also looking at the code and your screenshot, it says load_average is not in the array, but we check for that with a !empty. Something else is going on here. We do a strict type check, but that wouldn't error out.

I wouldn't even suspect a corrupted $modSettings, as that should still render the !empty check false.

from smf.

sbulen avatar sbulen commented on September 23, 2024

It's just kinda dumb, I think...

Yes, it checks empty on 382, but nowhere prior, e.g., 372 & 374.

I think this is happening when folks are restoring Unix backups, with this enabled, into wamps, where (I think) elsewhere in load.php it deletes the settings because it knows they don't apply.

I think we just need another check on 370.

from smf.

Sesquipedalian avatar Sesquipedalian commented on September 23, 2024

This looks like a simple logic problem to me. Lines 382 and 386 both have this:

if (!empty($modSettings['load_average']) || $modSettings['load_average'] === 0.0)

If $modSettings['load_average'] is not set, the first check will fail, and then the second check will produce the error.

The solution should be simple. Since the existing logic is meant to check that $modSettings['load_average'] either isn't empty or else is empty only because it is zero, we can just do this:

if (isset($modSettings['load_average']))

If it's really important that the value be a float rather than, say, an integer, just cast it to a float on the next line after this check.

from smf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.