• Resolved stylise

    (@stylise)


    WP 6.5.4
    PHP 8.1.29
    301 Redirects 2.7.5

    It appears that this plugin is triggering an error in canonical.php. Disabling this plugin causes this error to not trigger.

    PHP Warning: Undefined array key “scheme” in /…/wp-includes/canonical.php on line 751

    751: $redirect_url = $redirect[‘scheme’] . ‘://’ . $redirect[‘host’];

    • This topic was modified 9 months, 2 weeks ago by stylise.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Alexandru Tapuleasa

    (@talextech)

    Hmm, I really can’t see why 301 Redirects would do that. I’m not contradicting you, I understand disabling it fixes the issue but there must be some extra factor. Have you tried disabling other plugins except for 301 Redirects to see if it still happens or switching the theme? Maybe it’s something extra that I can set to reproduce the issue?

    Thread Starter stylise

    (@stylise)

    It’s one of four undefined array key errors that I’m tracking down after upgrading from PHP 7.4 to 8.1.

    • This reply was modified 9 months, 2 weeks ago by stylise.
    Plugin Author Alexandru Tapuleasa

    (@talextech)

    I tested it with all versions between PHP 7.4 to 8.3 so it’s not that. Do you have any Custom URLs in your redirects that don’t have http/https in front maybe?

    Thread Starter stylise

    (@stylise)

    All of the redirects start with https. Could it possibly have something to do with .htaccess settings?

    Plugin Author Alexandru Tapuleasa

    (@talextech)

    I don’t see why … that error in redirect_canonical() seems to come up if it gets passed a URL without http /https scheme. It’s why I assumed something else is altering URLs like that.

    And redirect_canonical gets called on most requests so if it was just 301 Redirects by itself we would have had a lot of reports about it very quickly.

    Thread Starter stylise

    (@stylise)

    I’m not sure why this keeps getting marked as resolved, unless the resolution is to uninstall the plugin.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Undefined array key in canonical.php’ is closed to new replies.