[wp-trac] [WordPress Trac] #11903: insert_with_markers is not threadsafe

WordPress Trac noreply at wordpress.org
Sat Sep 20 02:42:09 UTC 2014


#11903: insert_with_markers is not threadsafe
--------------------------+-----------------------------
 Reporter:  strings28     |       Owner:  westi
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  Future Release
Component:  Permalinks    |     Version:  2.9
 Severity:  major         |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------
Changes (by loushou):

 * keywords:  needs-patch => has-patch


Comment:

 After reading this whole thing, I totally agree that the right approach is
 to only write the config files when they actually have changes that need
 writing, instead of some other approach of limiting writing. A little
 digging shows that the IIS write functions already seem to do this. The
 mod_rewrite config writing function however does not seem to cover this
 yet.

 The function already checks if the block exists, but it does not make any
 distinction of whether it is the same block or not, and just blindly
 overwrites it. I adapted the function to test if the found block is the
 same block we are writing. If it is, we just don't write. If it is not the
 same block, then we replace it. Also if the file does not exist, or the
 block does not exist already, we still add it to the end of the file.

 Seems to work on 4.0+ (and the current nightly). Discuss.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/11903#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list