Compare commits

...

2 Commits

Author SHA1 Message Date
6b83a3a5d5 Properly fix the removal of makepathsafe(). Sheesh. 2023-08-18 13:42:42 -04:00
22ea6a1be1 Reset compath to / if it's empty 2023-08-18 13:37:00 -04:00
2 changed files with 8 additions and 3 deletions

View File

@ -24,6 +24,7 @@ if ( !isset($_SESSION['validated']) ) {
if ( !isset($_SESSION['compath']) ) { if ( !isset($_SESSION['compath']) ) {
$_SESSION['compath'] = '/'; $_SESSION['compath'] = '/';
} }
if ( $_SESSION['compath'] == "" ) $_SESSION['compath'] = "/";
// This session variable is set to the current comic in Base64 // This session variable is set to the current comic in Base64
if ( !isset($_SESSION['comfile']) ) { if ( !isset($_SESSION['comfile']) ) {

View File

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