mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-31 07:18:21 -04:00
Add safety check on PHP options lookup.
This commit is contained in:
parent
6ad53ec2aa
commit
509074c263
6 changed files with 26 additions and 23 deletions
|
@ -99,7 +99,7 @@ class Api {
|
|||
|
||||
private function on_getThumbHref() {
|
||||
|
||||
Util::json_fail(Util::RC_DISABLED, "thumbnails disabled", !$this->options["thumbnails"]["enabled"]);
|
||||
Util::json_fail(Util::RC_DISABLED, "thumbnails disabled", !$this->get_option("thumbnails.enabled", false));
|
||||
Util::json_fail(Util::RC_UNSUPPORTED, "thumbnails not supported", !HAS_PHP_JPG);
|
||||
|
||||
$type = Util::get_request_param("type");
|
||||
|
@ -117,7 +117,7 @@ class Api {
|
|||
|
||||
private function on_download() {
|
||||
|
||||
Util::json_fail(Util::RC_DISABLED, "downloads disabled", !$this->options["download"]["enabled"]);
|
||||
Util::json_fail(Util::RC_DISABLED, "downloads disabled", !$this->get_option("download.enabled", false));
|
||||
|
||||
$as = Util::get_request_param("as");
|
||||
$type = Util::get_request_param("type");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue