Download & Extend

restore current directory after register_shutdown_function callback.

Project:Drupal core
Version:7.x-dev
Component:base system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

While I can't point to any core bug this causes, and this can be solved in contrib, I think that we should save and restore the current working directory because this is a known problem with register_shutdown_function (see comments in thread) and a potential hazard for many people.

I just spent several hours tracking this down from devel, to our stream wrappers, and finally to the fact that the current-working-directory was changed to /. This is a very easy fix in core, very few extra lines, and will probably save other developers lots of time.

AttachmentSizeStatusTest resultOperations
shutdown-cwd.patch668 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 18,978 pass(es).View details

Comments

#1

rerolled, with proper diff (I hope)

AttachmentSizeStatusTest resultOperations
756498.patch748 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 18,969 pass(es).View details

#2

Status:needs review» reviewed & tested by the community

Very very nice job.

#3

Yeah, +1 from me too.

#4

Status:reviewed & tested by the community» fixed

Committed to CVS HEAD. Thanks!

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here