Properly fix the removal of makepathsafe(). Sheesh.

This commit is contained in:
Junior 2023-08-18 13:42:42 -04:00
parent 22ea6a1be1
commit 6b83a3a5d5

View File

@ -12,11 +12,15 @@ if ( isset($_REQUEST['sortorder']) ) {
$validext = array('cbr', 'cbz');
if ( $_SESSION['compath'] == "" ) $_SESSION['compath'] = "/";
if ( isset($_REQUEST['newpath']) ) {
$comicfull = realpath(COMICSDIR . base64_decode(urldecode($_REQUEST['newpath'])));
if ( ($comicfull === false) || (substr($comicfull, 0, strlen(COMICSDIR)) != COMICSDIR) ) $_SESSION['compath'] = "/";
$comicfull = realpath(COMICSDIR . urldecode($_REQUEST['newpath']));
if ( ($comicfull === false) || (substr($comicfull, 0, strlen(COMICSDIR)) != COMICSDIR) ) {
$_SESSION['compath'] = "/";
} else {
$_SESSION['compath'] = substr($comicfull, strlen(COMICSDIR));
}
}
$compath = $_SESSION['compath'];