[wp-trac] [WordPress Trac] #33112: Suppress calls to ini_set in core

WordPress Trac noreply at wordpress.org
Fri Jul 24 14:24:44 UTC 2015


#33112: Suppress calls to ini_set in core
--------------------------+-----------------------------
 Reporter:  mdwheele      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 On many shared hosts, the PHP function `ini_set` is disabled for security
 reasons. Calls to the function when it is disabled generate a warning that
 is usually not shown to the user because `display_errors` is configured as
 such. However, this event is still logged and for high traffic sites, this
 can create a ton of events.

 You can suppress warnings from this function by prepending an `@` symbol
 to the beginning of each call. We are already doing this in many places in
 core.

 By running `grep -r "[^@]ini_set" .` in the root of a WordPress
 installation, all occurrences will be located.

 In addition, the following command can be run in the root to patch all
 occurrences by prepending with an `@` symbol.

 {{{
 find . -type f -exec sed -i 's/@*ini_set/@ini_set/g' {} \;
 }}}

 This searches the current directory for all occurrences of `ini_set` with
 zero-or-more occurrences of `@` prepended. This is an idempotent command
 in that it should produce the same results if run many times. It could be
 made part of a build preparation process to clean occurrences of `ini_set`
 without suppression.

 I will be attaching a patch that makes these changes!

 Thanks!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33112>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list