Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Repeatable: Always
Steps to repeat:
- visit admin/config/media/imce/profile/edit/
- in the directory section, set this directory path:
php: return 'images_uploaded_by_users/'.$user->name;
- Save configuration
- visit imce
Expected Results:
User sees imce file browser.
Actual Results:
The browser says that the connection has been interrupted by the server. Checking in the Apache Error Log showed a segmentation fault
I don't know exactly why, but the problem is caused by the eval in imce_process_directories() function. Anyway, this simple patch to imce.page.inc file solves the problem:
@@ -776,7 +776,8 @@
foreach ($directories as $directory) {
if (substr($directory['name'], 0, 4) == 'php:') {
- $directory['name'] = eval(substr($directory['name'], 4));
+ $directory_name = substr($directory['name'], 4);
+ $directory['name'] = eval($directory_name);
//php may return an array of directories
if (is_array($directory['name'])) {
foreach ($directory['name'] as $name) {
Comments
Comment #1
ufku CreditAttribution: ufku commentedThis is probably an xdebug bug. Try updating it.
These could be related;
http://bugs.xdebug.org/view.php?id=586
https://bugs.php.net/bug.php?id=53479
Comment #2
antoniopironti CreditAttribution: antoniopironti commentedI've upgraded xdebug to the 2.1.3 version: all works fine now.
It seems that this bug affects only xdebug 2.0.5 : with xdebug 2.0.3 I haven't any problem.
Thank you very much for your quick reply and support.