• Resolved josekcit

    (@josekcit)



    Hi!

    I just detected this issue by chance. It’s a Fatal error thrown at wp-content/plugins/relevanssi/lib/init.php:98.

    To reproduce, just visit a url that contains page[] as parameter. Note I only consider this an issue because the error is thrown to non admin users, so any visitor or regular user can trigger it. Example url: https://mydomain.com/wp-admin/admin.php?page%5B%5D

    Here’s the stack trace:
    Fatal error: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in …\wp-includes\formatting.php:1596 Stack trace: #0 …\wp-includes\formatting.php(1596): preg_match(‘/[\\x80-\\xff]/’, Array) #1 …\wp-includes\formatting.php(2020): remove_accents(Array) #2 …\wp-content\plugins\relevanssi\lib\init.php(99): sanitize_file_name(Array) #3 …\wp-includes\class-wp-hook.php(324): relevanssi_init(”) #4 …\wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #5 …\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #6 …\wp-settings.php(727): do_action(‘init’) #7 …\wp-config.php(326): require_once(‘C:\\xampp\\htdocs…’) #8 …\wp-load.php(50): require_once(‘C:\\xampp\\htdocs…’) #9 …\wp-admin\admin.php(35): require_once(‘C:\\xampp\\htdocs…’) #10 {main} thrown in …\wp-includes\formatting.php on line 1596

    Possible solution:
    Checking wether the param value is a string would be a simple solution:

    if (isset($_GET['page']) && is_string($_GET['page'])) { // phpcs:ignore WordPress.Security.NonceVerification

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

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Fatal error on admin pages’ is closed to new replies.