Home Forums Themes Megatron Bug in megatron framework plugin on includes/Metabox,php:2134

Bug in megatron framework plugin on includes/Metabox,php:2134

  • Author
  • #153529


    Hi supporter !
    My website url : web61.de-webspace.de
    Description about error:
    I have found an issue on /plugins/megatron-framework/includes/Metabox.php on line 2134:
    $cnt = count(!empty($this->meta[$n])?$this->meta[$n]:NULL);

    This cause an error on PHP 7.3 because of the logic issue.
    The function count only accept countable values like an array or an object that implements countable.

    The correct code is:

    $cnt = (!empty($this->meta[$n])?count($this->meta[$n]):0;

    The value for the case that $this->meta[$n] is empty should be 0 instead of NULL because on line 2138 there’s a comparision and this caused a internal cast to int which also result in 0 but it need a little bit of unnecessary processing time. So I also changed it to a real numeric value.

    I have also mentioned this in the github you have provided: http://github.com/farinspace/wpalchemy.

    Please edit it to my code example asap.

    Kind regards

    b.o.o Alexander Behling
    mumbo jumbo media
    Bramstraße 19A
    49090 Osnabrück
    Fon: 0541 89700
    E-Mail: post@mumbomedia.de
    Internet: http://www.mumbomedia.de
    YouTube: http://www.youtube.de/mumbochannel
    Facebook: http://www.facebook.com/mumbomedia.de
    Instagram: http://www.instagram.com/mumbomedia
    Twitter: https://twitter.com/mumbojumbomedia

    Vertretungsberechtigte Gesellschafter: Udo Keil und Wolfgang D. Schott
    Inhaltlich Verantwortlicher gemäß § 5 TMG: Udo Keil und Wolfgang D. Schott
    (Anschrift wie oben)
    Umsatzsteuer ID: DE181987041

Cannot reply in this topic, If you have any issue, please create new topic