Title: masteriamnot's Replies | WordPress.org

---

# masteriamnot

  [  ](https://wordpress.org/support/users/masteriamnot/)

 *   [Profile](https://wordpress.org/support/users/masteriamnot/)
 *   [Topics Started](https://wordpress.org/support/users/masteriamnot/topics/)
 *   [Replies Created](https://wordpress.org/support/users/masteriamnot/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/masteriamnot/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/masteriamnot/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/masteriamnot/engagements/)
 *   [Favorites](https://wordpress.org/support/users/masteriamnot/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Invalid argument …foreach() in capabilities.php](https://wordpress.org/support/topic/invalid-argument-foreach-in-capabilitiesphp/)
 *  [masteriamnot](https://wordpress.org/support/users/masteriamnot/)
 * (@masteriamnot)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/invalid-argument-foreach-in-capabilitiesphp/#post-369028)
 * I’ve been struggling with this on IIS and have come up with a hack that seems
   to work. With my host, magic_quotes_gpc is on, and there is no way to turn it
   off. The problem starts on line 14 of capabilities.php – `$this->roles =get_option(
   $this->role_key);`
    The get_option function gets user role data that illamental
   refers to above. magic_quotes_gpc escapes the quotes, so the following lines 
   in capabilities.php don’t know how to handle the return value. I copied the get_options
   function (actually get_settings, which get_options calls), and changed the call
   on line 14 to point to the new function. The only difference is the new function
   uses stripslashes when getting the row from the db. Here’s the change in the 
   new function: `$value = stripslashes(wp_cache_get($setting, 'options')); // original:
   $value = wp_cache_get($setting, 'options'); I originally tried to just change
   get_settings, but it is used by other functions and errors popped up in other
   places. Magic_quotes_gpc still causes problems elsewhere, like if you have a 
   single quote or apostrophe in a post it causes an sql error. I’m still working
   on that.

Viewing 1 replies (of 1 total)