format
This commit is contained in:
parent
d17e207984
commit
f79eafc91e
@ -116,17 +116,16 @@ class PageRequestEvent extends Event
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function try_page_num(int $n): int {
|
public function try_page_num(int $n): int
|
||||||
|
{
|
||||||
if ($this->count_args() > $n) {
|
if ($this->count_args() > $n) {
|
||||||
$i = $this->get_arg($n);
|
$i = $this->get_arg($n);
|
||||||
if (!is_numeric($i) || $i <= 0) {
|
if (!is_numeric($i) || $i <= 0) {
|
||||||
return int_escape($i);
|
return int_escape($i);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,8 +58,7 @@ class AliasEditor extends Extension
|
|||||||
} else {
|
} else {
|
||||||
$page_number--;
|
$page_number--;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$page_number = 0;
|
$page_number = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,8 +62,7 @@ class ArrowkeyNavigation extends Extension
|
|||||||
"SELECT count FROM tags WHERE tag=:tag",
|
"SELECT count FROM tags WHERE tag=:tag",
|
||||||
["tag"=>$event->get_arg(0)]
|
["tag"=>$event->get_arg(0)]
|
||||||
) / $images_per_page);
|
) / $images_per_page);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// if there are no tags, use default
|
// if there are no tags, use default
|
||||||
$prefix = "";
|
$prefix = "";
|
||||||
$page_number = $event->try_page_num(0);
|
$page_number = $event->try_page_num(0);
|
||||||
|
@ -66,8 +66,7 @@ class ExtManager extends Extension
|
|||||||
$info = ExtensionInfo::get_by_key($ext);
|
$info = ExtensionInfo::get_by_key($ext);
|
||||||
$this->theme->display_doc($page, $info);
|
$this->theme->display_doc($page, $info);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$this->theme->display_table($page, $this->get_extensions(false), false);
|
$this->theme->display_table($page, $this->get_extensions(false), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -259,8 +259,7 @@ class Forum extends Extension
|
|||||||
} else {
|
} else {
|
||||||
$pageNumber--;
|
$pageNumber--;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$pageNumber = 0;
|
$pageNumber = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,8 +297,7 @@ class Forum extends Extension
|
|||||||
} else {
|
} else {
|
||||||
$pageNumber--;
|
$pageNumber--;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$pageNumber = 0;
|
$pageNumber = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,11 +41,9 @@ class ShimmieApi extends Extension
|
|||||||
if ($event->page_matches("api/shimmie/get_tags")) {
|
if ($event->page_matches("api/shimmie/get_tags")) {
|
||||||
if ($event->count_args() > 0) {
|
if ($event->count_args() > 0) {
|
||||||
$tag = $event->get_arg(0);
|
$tag = $event->get_arg(0);
|
||||||
}
|
} elseif (isset($_GET['tag'])) {
|
||||||
elseif (isset($_GET['tag'])) {
|
|
||||||
$tag = $_GET['tag'];
|
$tag = $_GET['tag'];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$tag = null;
|
$tag = null;
|
||||||
}
|
}
|
||||||
$res = $this->api_get_tags($tag);
|
$res = $this->api_get_tags($tag);
|
||||||
|
@ -130,11 +130,9 @@ class TranscodeImage extends Extension
|
|||||||
if ($event->page_matches("transcode") && $user->can(Permissions::EDIT_FILES)) {
|
if ($event->page_matches("transcode") && $user->can(Permissions::EDIT_FILES)) {
|
||||||
if ($event->count_args() >= 1) {
|
if ($event->count_args() >= 1) {
|
||||||
$image_id = int_escape($event->get_arg(0));
|
$image_id = int_escape($event->get_arg(0));
|
||||||
}
|
} elseif (isset($_POST['image_id'])) {
|
||||||
elseif(isset($_POST['image_id'])) {
|
|
||||||
$image_id = int_escape($_POST['image_id']);
|
$image_id = int_escape($_POST['image_id']);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
throw new ImageTranscodeException("Can not resize Image: No valid Image ID given.");
|
throw new ImageTranscodeException("Can not resize Image: No valid Image ID given.");
|
||||||
}
|
}
|
||||||
$image_obj = Image::by_id($image_id);
|
$image_obj = Image::by_id($image_id);
|
||||||
|
@ -21,11 +21,9 @@ class Trash extends Extension
|
|||||||
// Try to get the image ID
|
// Try to get the image ID
|
||||||
if ($event->count_args() >= 1) {
|
if ($event->count_args() >= 1) {
|
||||||
$image_id = int_escape($event->get_arg(0));
|
$image_id = int_escape($event->get_arg(0));
|
||||||
}
|
} elseif (isset($_POST['image_id'])) {
|
||||||
elseif (isset($_POST['image_id'])) {
|
|
||||||
$image_id = $_POST['image_id'];
|
$image_id = $_POST['image_id'];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
throw new SCoreException("Can not restore image: No valid Image ID given.");
|
throw new SCoreException("Can not restore image: No valid Image ID given.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,11 +189,9 @@ class Upload extends Extension
|
|||||||
// Try to get the image ID
|
// Try to get the image ID
|
||||||
if ($event->count_args() >= 1) {
|
if ($event->count_args() >= 1) {
|
||||||
$image_id = int_escape($event->get_arg(0));
|
$image_id = int_escape($event->get_arg(0));
|
||||||
}
|
} elseif (isset($_POST['image_id'])) {
|
||||||
elseif(isset($_POST['image_id'])) {
|
|
||||||
$image_id = $_POST['image_id'];
|
$image_id = $_POST['image_id'];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
throw new UploadException("Can not replace Image: No valid Image ID given.");
|
throw new UploadException("Can not replace Image: No valid Image ID given.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user