Revert added exception in the sandbox (#3893)

This commit is contained in:
Léo Colombaro 2025-04-06 22:46:07 +02:00 committed by GitHub
parent b3848d4833
commit ef18d1d29e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 3 deletions

View File

@ -1316,8 +1316,6 @@ function yourls_include_file_sandbox($file) {
require_once $file; require_once $file;
yourls_debug_log("loaded $file"); yourls_debug_log("loaded $file");
return true; return true;
} else {
throw new \Exception('File not readable');
} }
} catch ( \Throwable $e ) { } catch ( \Throwable $e ) {
yourls_debug_log("could not load $file"); yourls_debug_log("could not load $file");

View File

@ -25,7 +25,7 @@ class FileLoaderTest extends PHPUnit\Framework\TestCase {
* Load missing file = string * Load missing file = string
*/ */
public function test_load_file_not_exists() { public function test_load_file_not_exists() {
$this->assertIsString( yourls_include_file_sandbox( YOURLS_TESTDATA_DIR . "/" . rand_str() . ".php" ) ); $this->assertNull( yourls_include_file_sandbox( YOURLS_TESTDATA_DIR . "/" . rand_str() . ".php" ) );
} }
/** /**