• Der-Bank-Blog

    (@der-bank-blog)


    Hi,

    I’m seeing repeated PHP 8 deprecation warnings in upPrev:

    preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

    The warning originates from:

    includes/iworks/upprev.php, method print_custom_style()

    The issue appears to be that:

    $this->options->get_option( 'css' )

    can return null and is then passed directly to preg_replace().

    A possible fix would be to ensure that the value is a string before processing it, e.g.:

    $css = $this->options->get_option( 'css' );

    if ( $css === null ) {
    $css = '';
    }

    Could you please check this for a future update?

    Best regards
    Hansjörg

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @der-bank-blog

    Please check 4.1.4 version (you have to wait for wordpress.org 6 hours or get it grom github).

    Marcin

    Thread Starter Der-Bank-Blog

    (@der-bank-blog)

    Hi Marcin,

    thanks for your quick response yesterday.

    After installing the latest upPrev update, I encountered another issue. This time it causes a fatal PHP error on single posts:

    PHP Fatal error: Uncaught Error: Class "Mobile_Detect" not found

    The error occurs in:

    /includes/iworks/upprev.php, line 113

    The current code is:

    $detect = new Mobile_Detect;

    However, the vendor/Mobile_Detect.php file included with the plugin uses:

    namespace Detection;

    and defines the class as:

    class MobileDetect

    So the class appears to need to be instantiated as:

    $detect = new \Detection\MobileDetect();

    Changing this line fixes the fatal error on my site.

    Could you please check whether this needs to be corrected in the plugin?

    Thanks again for your help and quick support.

    Best regards
    Hansjörg

    [ Please do not bump. ]

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.