file uploads file when memcache statistics are written to page footer - easy fix
ultimike - October 10, 2008 - 18:16
| Project: | Memcache API and Integration |
| Version: | 5.x-1.8 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
When "memcache admin" is enabled, and the "show memcache statistics at the bottom of each page" option is selected on admin/settings/memcache, file uploads fail.
The fix is easy, just replace the following line in memcache_admin_init():
if (($user->uid == 0) || strstr($_SERVER['PHP_SELF'], 'update.php') || strstr($_GET['q'], 'autocomplete')) {
with this (heavily borrowing from devel module)
if (($user->uid == 0) || strstr($_SERVER['PHP_SELF'], 'update.php') || strstr($_GET['q'], 'autocomplete') || $_GET['q'] == 'admin/content/node-settings/rebuild' || $_GET['q'] == 'upload/js' || substr($_GET['q'], 0, strlen('system/files')) == 'system/files') {
-mike

#1
Can someone test this and confirm it solves the problem? (Attaching a real patch would certainly help...)
#2
#3
Hi,
i run into this issue on a drupal installation using imagecache. for some reason imagecache is redirecting to itsself if a picture is rebuild with imagemagick or gd-lib. in this case drupal has not run the full bootstrap so no theming is available. memcache admin still wants so theme the memcache stats, and therefor has to implement theming functions. but in php's shutdown function working directory is set to / so no relative requires or includes are possible.
in memcache.admin on line 223 you still check for soe content-types which don't like text outputs, maybe it is usefull to check some more (dunno what header exists while processing images) here?