Changed the disputed while loop to a single if.

This commit is contained in:
dratini0 2015-03-23 16:12:03 +01:00
parent 10e13b172a
commit c432b52c74

View file

@ -184,8 +184,8 @@ class OC_Files {
if (isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])) { if (isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])) {
if (isset($_SERVER['MOD_X_ACCEL_REDIRECT_PREFIX'])) { if (isset($_SERVER['MOD_X_ACCEL_REDIRECT_PREFIX'])) {
$prefix = $_SERVER['MOD_X_ACCEL_REDIRECT_PREFIX']; $prefix = $_SERVER['MOD_X_ACCEL_REDIRECT_PREFIX'];
// nginx is picky about double slashes // nginx is picky about double slashes when matching locations
while($prefix[strlen($prefix) - 1] === '/'){ if($prefix[strlen($prefix) - 1] === '/'){
$prefix = substr($prefix, 0, -1); $prefix = substr($prefix, 0, -1);
} }
$filename = $prefix . \OC\Files\Filesystem::getLocalFile($filename); $filename = $prefix . \OC\Files\Filesystem::getLocalFile($filename);