Use SCRIPT_NAME instead of PHP_SELF which won't send the PATH_INFO, this prevents XSS in old browsers. Thanks to Nico Golde.

remotes/origin/stable45
Lukas Reschke 13 years ago committed by Jörn Friedrich Dreyer
parent 4d3c45a826
commit 4e5291c77a
  1. 2
      apps/files/index.php

@ -39,7 +39,7 @@ OCP\App::setActiveNavigationEntry( 'files_index' );
$dir = isset( $_GET['dir'] ) ? stripslashes($_GET['dir']) : ''; $dir = isset( $_GET['dir'] ) ? stripslashes($_GET['dir']) : '';
// Redirect if directory does not exist // Redirect if directory does not exist
if(!OC_Filesystem::is_dir($dir.'/')) { if(!OC_Filesystem::is_dir($dir.'/')) {
header('Location: '.$_SERVER['PHP_SELF'].''); header('Location: '.$_SERVER['SCRIPT_NAME'].'');
} }
$files = array(); $files = array();

Loading…
Cancel
Save