Replace string path with constant

This commit is contained in:
Alex Cabal 2020-05-02 21:13:34 -05:00
parent 986183a83f
commit 822ba2a3d7

View file

@ -26,7 +26,7 @@ try{
// This iterator will do a deep scan on the directory. When we hit another directory, the filename will be "." and the path will contain the directory path. // This iterator will do a deep scan on the directory. When we hit another directory, the filename will be "." and the path will contain the directory path.
// We want to find where the "src" directory is, and the directory directly below that will be the final web URL we're looking for. // We want to find where the "src" directory is, and the directory directly below that will be the final web URL we're looking for.
if($file->getFilename() == '.' && preg_match('|/src$|ius', $file->getPath())){ if($file->getFilename() == '.' && preg_match('|/src$|ius', $file->getPath())){
throw new SeeOtherEbookException(preg_replace(['|' . SITE_ROOT . '/web/www|ius', '|/src$|ius'], '', $file->getPath())); throw new SeeOtherEbookException(preg_replace(['|' . WEB_ROOT . '|ius', '|/src$|ius'], '', $file->getPath()));
} }
} }
} }