Title: Bug: PHP Warning: Illegal offset type
Last modified: February 1, 2018

---

# Bug: PHP Warning: Illegal offset type

 *  [sumio36](https://wordpress.org/support/users/sumio36/)
 * (@sumio36)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/bug-php-warning-illegal-offset-type/)
 * 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 8 years, 4 months ago by [sumio36](https://wordpress.org/support/users/sumio36/).
    -  This topic was modified 8 years, 4 months ago by [sumio36](https://wordpress.org/support/users/sumio36/).
    -  This topic was modified 8 years, 4 months ago by [sumio36](https://wordpress.org/support/users/sumio36/).

Viewing 1 replies (of 1 total)

 *  [aliciagh](https://wordpress.org/support/users/aliciagh/)
 * (@aliciagh)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/bug-php-warning-illegal-offset-type/#post-10047855)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-https_bec2c9.svg)
 * [WordPress HTTPS (SSL)](https://wordpress.org/plugins/wordpress-https/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-https/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-https/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-https/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-https/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-https/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [aliciagh](https://wordpress.org/support/users/aliciagh/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/bug-php-warning-illegal-offset-type/#post-10047855)
 * Status: not resolved