Skip to content

utils.php throws warning for undefined array key 'host' #158

Description

@mjdewitt

This warning is popping up in my logs:

stderr: "PHP message: PHP Warning: Undefined array key "host" in /wp-content/plugins/powered-cache/includes/utils.php on line 938"

It looks like the code assumes this exists and I'm not sure if any of the parsed url components are guaranteed to exist.

I've patched mine with

938 $sub_dir = isset($url_info['host']) ? $url_info['host'] : '' ;

if ( isset($url_info['path']) && ! empty( $url_info['path'] ) ) {

Hope this helps.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions