• Resolved Ov3rfly

    (@ov3rfly)


    Getting these warnings in debug.log

    [20-Jan-2025 08:07:15 UTC] PHP Deprecated:  ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in .../wp-includes/formatting.php on line 4494
    [20-Jan-2025 08:07:15 UTC] PHP Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in .../wp-includes/formatting.php on line 4494
    [20-Jan-2025 08:07:15 UTC] PHP Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in .../wp-includes/formatting.php on line 4494

    Backtrace example:

    #0 .../wp-includes/formatting.php(4622): esc_url(NULL, NULL, 'db')
    #1 .../wp-content/plugins/event-post/eventpost.php(2410): sanitize_url(NULL)
    #2 .../wp-includes/class-wp-hook.php(326): EventPost->save_postdata(167850)
    #3 .../wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(167850, Array)
    #4 .../wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #5 .../wp-includes/post.php(4760): do_action('save_post', 167850, Object(WP_Post), true)
    #6 .../wp-includes/post.php(4862): wp_insert_post(Array, false, true)
    #7 .../wp-admin/includes/post.php(453): wp_update_post(Array)
    #8 .../wp-admin/includes/ajax-actions.php(2138): edit_post()
    #9 .../wp-includes/class-wp-hook.php(324): wp_ajax_inline_save('')
    #10 .../wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #11 .../wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #12 .../wp-admin/admin-ajax.php(188): do_action('wp_ajax_inline-...')

    Current code:

    2404: if (false !== $virtual_location = filter_input(INPUT_POST, $this->META_VIRTUAL_LOCATION, FILTER_SANITIZE_URL)) {
    2405: update_post_meta($post_id, $this->META_VIRTUAL_LOCATION, sanitize_url($virtual_location));
    2406: }

    Function sanitize_url($virtual_location) is called with NULL value there.

    Suggested fix: Check values for NULL before use.

    Event post 5.9.8, WordPress 6.4.5

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Ov3rfly

    (@ov3rfly)

    Note: Above backtrace example shows line numbers with our debug code added, so line 2410 mentioned there at eventpost.php(2410) in #1 is actually line 2405 in original plugin, see also current code snippet.

    Thread Starter Ov3rfly

    (@ov3rfly)

    Issue is still there.

    Event post 5.9.10

    Plugin Author Bastien Ho

    (@bastho)

    Hi, thank you for reporting this warning.

    It has been fixed in v5.9.11

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.