• Hi, I Found a bug.
    Use: WordPress HTTPS (SSL) v3.4.0

    [error_log]
    PHP Warning: array_key_exists(): The first argument should be either a string or an integer in /…/wp-content/plugins/wordpress-https/lib/WordPressHTTPS.php on line 352
    PHP Warning: Illegal offset type in /…/wp-content/plugins/wordpress-https/lib/WordPressHTTPS.php on line 359

    This error is bug in class WordPressHTTPS method public function isUrlLocal($url).
    Variable $url must be string type, but it is Mvied_Url object.
    Almost, Magic __toString method that is called when the object is casted to a string.
    But this is not the case.

    For example)
    class WordPressHTTPS_Module_Parser method:public function normalizeElements()
    $this->_html = str_replace($url, $plugin->makeUrlHttp($url), $this->_html); (171 line)
    *) Variable $url is Mvied_Url object.
    -> call class WordPressHTTPS method:makeUrlHttp( $string )
    if ( $this->isUrlLocal($string) ) {  (462 line)
    -> class WordPressHTTPS method: public function isUrlLocal($url) {
    *) argument $url is Mvied_Url object.

    — lib/WordPressHTTPS/Module/Parser.php.orig 2018-02-01 13:33:33.372346044 +0900
    +++ lib/WordPressHTTPS/Module/Parser.php 2018-02-01 13:40:09.156975285 +0900
    @@ -168,7 +168,7 @@
    if ( isset($matches[1][$i]) ) {
    $url_parts = parse_url($matches[1][$i]);
    if ( $url_parts && strpos($url_parts[‘path’], ‘wp-admin’) === false && strpos($url_parts[‘path’], ‘wp-login’) === false ) {
    – $this->_html = str_replace($url, $plugin->makeUrlHttp($url), $this->_html);
    + $this->_html = str_replace($url, $plugin->makeUrlHttp($url->toString()), $this->_html);
    }
    }
    }

    • This topic was modified 7 years, 1 month ago by sumio36.
    • This topic was modified 7 years, 1 month ago by sumio36.
    • This topic was modified 7 years, 1 month ago by sumio36.
Viewing 1 replies (of 1 total)
  • aliciagh

    (@aliciagh)

    Hello,

    I have the same problem. I’ve applied your patch and now the message doesn’t appear in the error log.

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Bug: PHP Warning: Illegal offset type’ is closed to new replies.