Explorar o código

! Use the right variable when doing directory-traversal exploit prevention

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer %!s(int64=10) %!d(string=hai) anos
pai
achega
f0afe3cc48
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Sources/Themes.php

+ 1 - 1
Sources/Themes.php

@@ -1687,7 +1687,7 @@ function EditTheme()
 				$_GET['directory'] = preg_replace(array('~^[\./\\:\0\n\r]+~', '~[\\\\]~', '~/[\./]+~'), array('', '/', '/'), $_GET['directory']);
 
 				$temp = realpath($currentTheme['theme_dir'] . '/' . $_GET['directory']);
-				if (empty($temp) || substr($temp, 0, strlen(realpath($theme_dir))) != realpath($theme_dir))
+				if (empty($temp) || substr($temp, 0, strlen(realpath($currentTheme['theme_dir']))) != realpath($currentTheme['theme_dir']))
 					$_GET['directory'] = '';
 			}
 		}