Magic Gallery
Document root can't be relied upon in virtual environments (1 post)

  1. SeekingSerenity
    Posted 4 years ago #

    In virtual hosting environments document root may not point to a valid location and/or soft links may mean that you're not in the directory you think you are. This breaks the thumbnailing code in image.php and you just end up with grey boxes where the thumbnails should be.

    I made the following change in line 156 of image.php:

    // Strip the possible trailing slash off the document root
    // WRONG $docRoot = preg_replace('/\/$/', '', DOCUMENT_ROOT);
    $docRoot = realpath(CURRENT_DIR . '/../../..');


Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 4 years ago by SeekingSerenity
  • This topic is not resolved
  • WordPress version: 3.3.1