• Resolved niburu

    (@niburu)


    Hello,

    my server logs show me this error “[STDERR] PHP Warning: A non-numeric value encountered in /wp-content/plugins/litespeed-cache/src/media.cls.php on line 657\n

    Line 657 is $ori_height = intval($ori_height * $attrs[‘width’] / $ori_width);

    How can i fix this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support qtwrk

    (@qtwrk)

    could you please change this ?

    in line 653-654

    change

    ori_width = $dimensions[0];
    						$ori_height = $dimensions[1];

    to

    ori_width = (int) $dimensions[0];
    						$ori_height = (int) $dimensions[1];

    and see if this warning still pops up ?

    Thread Starter niburu

    (@niburu)

    Addes a $ infront of the first ori in your example and replaced the code in Line 653-654 but i still get the error.

    2023-11-30 06:24:08.892891 [NOTICE] [1544284] [T0] [**********:49266#APVH_************:443] [STDERR] PHP Warning: A non-numeric value encountered in /home/*******/public_html/wp-content/plugins/litespeed-cache/src/media.cls.php on line 658\n

    *** is a replacement i added for my folders.

    Thread Starter niburu

    (@niburu)

    I have no clue of programming but inspired by your example i changed line 658 to the following $ori_height = intval($ori_height * (int)$attrs['width'] / $ori_width);

    The Error is now gone and the site still runs. I also keept your suggested change to the code.

    • This reply was modified 11 months, 4 weeks ago by niburu.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP Warning: litespeed-cache/src/media.cls’ is closed to new replies.