diff --git a/core/imageboard/image.php b/core/imageboard/image.php
index 3aa79868..e6f07a96 100644
--- a/core/imageboard/image.php
+++ b/core/imageboard/image.php
@@ -27,7 +27,7 @@ class Image
/** @var string */
public $hash;
- /** @var int */
+ /** @var int */
public $filesize;
/** @var string */
@@ -78,13 +78,11 @@ class Image
$name = str_replace("images.", "", $name);
// hax, this is likely the cause of much scrutinizer-ci complaints.
- if(in_array($name, ["locked", "lossless", "video", "audio"])) {
+ if (in_array($name, ["locked", "lossless", "video", "audio"])) {
$this->$name = bool_escape($value);
- }
- elseif(in_array($name, ["id", "owner_id", "height", "width", "filesize", "length"])) {
+ } elseif (in_array($name, ["id", "owner_id", "height", "width", "filesize", "length"])) {
$this->$name = int_escape($value);
- }
- else {
+ } else {
$this->$name = $value;
}
}
diff --git a/core/util.php b/core/util.php
index 22056b2d..074d61e6 100644
--- a/core/util.php
+++ b/core/util.php
@@ -699,7 +699,8 @@ function SHM_FORM(string $target, string $method="POST", bool $multipart=false,
);
}
-function SHM_SIMPLE_FORM($target, ...$children) {
+function SHM_SIMPLE_FORM($target, ...$children)
+{
$form = SHM_FORM($target);
$form->appendChild(emptyHTML(...$children));
return $form;
diff --git a/ext/approval/main.php b/ext/approval/main.php
index a3e47ae7..417a279b 100644
--- a/ext/approval/main.php
+++ b/ext/approval/main.php
@@ -129,7 +129,9 @@ class Approval extends Extension
$event->add_querylet(new Querylet($database->scoreql_to_sql("approved = SCORE_BOOL_Y ")));
}
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
if (preg_match(self::SEARCH_REGEXP, strtolower($event->term), $matches)) {
if ($user->can(Permissions::APPROVE_IMAGE) && $matches[1] == "no") {
$event->add_querylet(new Querylet($database->scoreql_to_sql("approved = SCORE_BOOL_N ")));
diff --git a/ext/artists/main.php b/ext/artists/main.php
index 1bd91efc..ac5b6c66 100644
--- a/ext/artists/main.php
+++ b/ext/artists/main.php
@@ -42,7 +42,9 @@ class Artists extends Extension
public function onSearchTermParse(SearchTermParseEvent $event)
{
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
$matches = [];
if (preg_match("/^(author|artist)[=|:](.*)$/i", $event->term, $matches)) {
diff --git a/ext/blocks/theme.php b/ext/blocks/theme.php
index acb33498..9604783d 100644
--- a/ext/blocks/theme.php
+++ b/ext/blocks/theme.php
@@ -1,5 +1,13 @@
"hidden", "name"=>"id", "value"=>$block['id']]),
- TH("Title"), TD(INPUT(["type"=>"text", "name"=>"title", "value"=>$block['title']])),
- TH("Area"), TD(INPUT(["type"=>"text", "name"=>"area", "value"=>$block['area']])),
- TH("Priority"), TD(INPUT(["type"=>"text", "name"=>"priority", "value"=>$block['priority']])),
- TH("Pages"), TD(INPUT(["type"=>"text", "name"=>"pages", "value"=>$block['pages']])),
- TH("Delete"), TD(INPUT(["type"=>"checkbox", "name"=>"delete"])),
+ TH("Title"),
+ TD(INPUT(["type"=>"text", "name"=>"title", "value"=>$block['title']])),
+ TH("Area"),
+ TD(INPUT(["type"=>"text", "name"=>"area", "value"=>$block['area']])),
+ TH("Priority"),
+ TD(INPUT(["type"=>"text", "name"=>"priority", "value"=>$block['priority']])),
+ TH("Pages"),
+ TD(INPUT(["type"=>"text", "name"=>"pages", "value"=>$block['pages']])),
+ TH("Delete"),
+ TD(INPUT(["type"=>"checkbox", "name"=>"delete"])),
TD(INPUT(["type"=>"submit", "value"=>"Save"]))
),
TR(
@@ -32,10 +45,14 @@ class BlocksTheme extends Themelet
$html->appendChild(SHM_SIMPLE_FORM(
make_link("blocks/add"),
TR(
- TH("Title"), TD(INPUT(["type"=>"text", "name"=>"title", "value"=>""])),
- TH("Area"), TD(SELECT(["name"=>"area"], OPTION("left"), OPTION("main"))),
- TH("Priority"), TD(INPUT(["type"=>"text", "name"=>"priority", "value"=>'50'])),
- TH("Pages"), TD(INPUT(["type"=>"text", "name"=>"pages", "value"=>'post/list*'])),
+ TH("Title"),
+ TD(INPUT(["type"=>"text", "name"=>"title", "value"=>""])),
+ TH("Area"),
+ TD(SELECT(["name"=>"area"], OPTION("left"), OPTION("main"))),
+ TH("Priority"),
+ TD(INPUT(["type"=>"text", "name"=>"priority", "value"=>'50'])),
+ TH("Pages"),
+ TD(INPUT(["type"=>"text", "name"=>"pages", "value"=>'post/list*'])),
TD(["colspan"=>'3'], INPUT(["type"=>"submit", "value"=>"Add"]))
),
TR(
diff --git a/ext/comment/main.php b/ext/comment/main.php
index 6622bd24..a9f43896 100644
--- a/ext/comment/main.php
+++ b/ext/comment/main.php
@@ -342,7 +342,9 @@ class CommentList extends Extension
public function onSearchTermParse(SearchTermParseEvent $event)
{
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
$matches = [];
if (preg_match("/^comments([:]?<|[:]?>|[:]?<=|[:]?>=|[:|=])(\d+)$/i", $event->term, $matches)) {
diff --git a/ext/custom_html_headers/main.php b/ext/custom_html_headers/main.php
index 6cf4a556..ffeb938e 100644
--- a/ext/custom_html_headers/main.php
+++ b/ext/custom_html_headers/main.php
@@ -55,12 +55,13 @@ class CustomHtmlHeaders extends Extension
$sitename_in_title = $config->get_string("sitename_in_title");
// sitename is already in title (can occur on index & other pages)
- if(strstr($page->title, $site_title)) return;
+ if (strstr($page->title, $site_title)) {
+ return;
+ }
if ($sitename_in_title == "prefix") {
$page->title = "$site_title - $page->title";
- }
- elseif ($sitename_in_title == "suffix") {
+ } elseif ($sitename_in_title == "suffix") {
$page->title = "$page->title - $site_title";
}
}
diff --git a/ext/favorites/main.php b/ext/favorites/main.php
index b54f6dd0..6753debd 100644
--- a/ext/favorites/main.php
+++ b/ext/favorites/main.php
@@ -118,7 +118,9 @@ class Favorites extends Extension
public function onSearchTermParse(SearchTermParseEvent $event)
{
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
$matches = [];
if (preg_match("/^favorites([:]?<|[:]?>|[:]?<=|[:]?>=|[:|=])(\d+)$/i", $event->term, $matches)) {
diff --git a/ext/index/main.php b/ext/index/main.php
index e1172367..f59ea7f4 100644
--- a/ext/index/main.php
+++ b/ext/index/main.php
@@ -164,7 +164,9 @@ class Index extends Extension
public function onSearchTermParse(SearchTermParseEvent $event)
{
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
$matches = [];
// check for tags first as tag based searches are more common.
diff --git a/ext/index/theme.php b/ext/index/theme.php
index f4805706..d779406f 100644
--- a/ext/index/theme.php
+++ b/ext/index/theme.php
@@ -44,13 +44,13 @@ and of course start organising your images :-)
if (count($images) > 0) {
$this->display_page_images($page, $images);
- if($this->page_number < $this->total_pages) {
- $next = $this->page_number + 1;
- $u_tags = url_escape(Tag::implode($this->search_terms));
- $query = empty($u_tags) ? "" : '/'.$u_tags;
- $next = make_link('post/list'.$query.'/'.$next);
- $page->add_html_header("");
- }
+ if ($this->page_number < $this->total_pages) {
+ $next = $this->page_number + 1;
+ $u_tags = url_escape(Tag::implode($this->search_terms));
+ $query = empty($u_tags) ? "" : '/'.$u_tags;
+ $next = make_link('post/list'.$query.'/'.$next);
+ $page->add_html_header("");
+ }
} else {
$this->display_error(404, "No Images Found", "No images were found to match the search criteria");
}
diff --git a/ext/media/main.php b/ext/media/main.php
index 860d8c1a..0f278ca0 100644
--- a/ext/media/main.php
+++ b/ext/media/main.php
@@ -257,7 +257,9 @@ class Media extends Extension
{
global $database;
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
$matches = [];
if (preg_match(self::CONTENT_SEARCH_TERM_REGEX, $event->term, $matches)) {
diff --git a/ext/notes/main.php b/ext/notes/main.php
index 4c3542ec..e77f19cb 100644
--- a/ext/notes/main.php
+++ b/ext/notes/main.php
@@ -188,7 +188,9 @@ class Notes extends Extension
*/
public function onSearchTermParse(SearchTermParseEvent $event)
{
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
$matches = [];
if (preg_match("/^note[=|:](.*)$/i", $event->term, $matches)) {
diff --git a/ext/numeric_score/main.php b/ext/numeric_score/main.php
index d61eb235..adb8ab85 100644
--- a/ext/numeric_score/main.php
+++ b/ext/numeric_score/main.php
@@ -223,7 +223,9 @@ class NumericScore extends Extension
public function onSearchTermParse(SearchTermParseEvent $event)
{
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
$matches = [];
if (preg_match("/^score([:]?<|[:]?>|[:]?<=|[:]?>=|[:|=])(-?\d+)$/i", $event->term, $matches)) {
diff --git a/ext/numeric_score/theme.php b/ext/numeric_score/theme.php
index 6fd82ad0..4023f185 100644
--- a/ext/numeric_score/theme.php
+++ b/ext/numeric_score/theme.php
@@ -6,7 +6,9 @@ class NumericScoreTheme extends Themelet
{
global $user, $page;
$i_image_id = $image->id;
- if(is_string($image->numeric_score)) $image->numeric_score = (int)$image->numeric_score;
+ if (is_string($image->numeric_score)) {
+ $image->numeric_score = (int)$image->numeric_score;
+ }
$i_score = $image->numeric_score;
$html = "
diff --git a/ext/pools/main.php b/ext/pools/main.php
index 7f94fee8..b776310f 100644
--- a/ext/pools/main.php
+++ b/ext/pools/main.php
@@ -378,7 +378,9 @@ class Pools extends Extension
public function onSearchTermParse(SearchTermParseEvent $event)
{
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
$matches = [];
if (preg_match("/^pool[=|:]([0-9]+|any|none)$/i", $event->term, $matches)) {
diff --git a/ext/rating/main.php b/ext/rating/main.php
index 77163aca..80588899 100644
--- a/ext/rating/main.php
+++ b/ext/rating/main.php
@@ -250,7 +250,9 @@ class Ratings extends Extension
{
global $user;
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
$matches = [];
if (is_null($event->term) && $this->no_rating_query($event->context)) {
diff --git a/ext/relationships/main.php b/ext/relationships/main.php
index 95f399f1..1cfe0f9a 100644
--- a/ext/relationships/main.php
+++ b/ext/relationships/main.php
@@ -56,7 +56,9 @@ class Relationships extends Extension
public function onSearchTermParse(SearchTermParseEvent $event)
{
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
$matches = [];
if (preg_match("/^parent[=|:]([0-9]+|any|none)$/", $event->term, $matches)) {
diff --git a/ext/setup/main.php b/ext/setup/main.php
index 7003c8eb..3b148ef6 100644
--- a/ext/setup/main.php
+++ b/ext/setup/main.php
@@ -223,10 +223,9 @@ class SetupBlock extends Block
public function add_choice_option(string $name, array $options, string $label=null, bool $table_row = false)
{
global $config;
- if(is_int(array_values($options)[0])) {
+ if (is_int(array_values($options)[0])) {
$current = $config->get_int($name);
- }
- else {
+ } else {
$current = $config->get_string($name);
}
diff --git a/ext/setup/theme.php b/ext/setup/theme.php
index fbfd0d0f..56e29460 100644
--- a/ext/setup/theme.php
+++ b/ext/setup/theme.php
@@ -44,7 +44,9 @@ class SetupTheme extends Themelet
$h_rows = "";
ksort($options);
foreach ($options as $name => $value) {
- if(is_null($value)) $value = '';
+ if (is_null($value)) {
+ $value = '';
+ }
$h_name = html_escape($name);
$h_value = html_escape((string)$value);
diff --git a/ext/tag_categories/main.php b/ext/tag_categories/main.php
index 5501de9e..f9579ffe 100644
--- a/ext/tag_categories/main.php
+++ b/ext/tag_categories/main.php
@@ -66,7 +66,9 @@ class TagCategories extends Extension
public function onSearchTermParse(SearchTermParseEvent $event)
{
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
$matches = [];
if (preg_match("/^(.+)tags([:]?<|[:]?>|[:]?<=|[:]?>=|[:|=])([0-9]+)$/i", $event->term, $matches)) {
diff --git a/ext/tagger/theme.php b/ext/tagger/theme.php
index 9130a7fe..815b11fc 100644
--- a/ext/tagger/theme.php
+++ b/ext/tagger/theme.php
@@ -1,5 +1,7 @@
add_querylet(new Querylet($database->scoreql_to_sql("trash = SCORE_BOOL_N ")));
}
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
if (preg_match(self::SEARCH_REGEXP, strtolower($event->term), $matches)) {
if ($user->can(Permissions::VIEW_TRASH)) {
$event->add_querylet(new Querylet($database->scoreql_to_sql("trash = SCORE_BOOL_Y ")));
diff --git a/ext/upload/main.php b/ext/upload/main.php
index b2f91f43..7e695058 100644
--- a/ext/upload/main.php
+++ b/ext/upload/main.php
@@ -109,13 +109,13 @@ class Upload extends Extension
$min_free_space = $config->get_int("upload_min_free_space");
if ($min_free_space > 0) {
// SHIT: fucking PHP "security" measures -_-;;;
- $img_path = realpath("./images/");
- if($img_path) {
- $free_num = @disk_free_space($img_path);
- if ($free_num !== false) {
- $this->is_full = $free_num < $min_free_space;
- }
- }
+ $img_path = realpath("./images/");
+ if ($img_path) {
+ $free_num = @disk_free_space($img_path);
+ if ($free_num !== false) {
+ $this->is_full = $free_num < $min_free_space;
+ }
+ }
}
}
diff --git a/ext/user/main.php b/ext/user/main.php
index a61105ed..26355815 100644
--- a/ext/user/main.php
+++ b/ext/user/main.php
@@ -331,7 +331,9 @@ class UserPage extends Extension
{
global $user;
- if(is_null($event->term)) return;
+ if (is_null($event->term)) {
+ return;
+ }
$matches = [];
if (preg_match("/^(?:poster|user)[=|:](.*)$/i", $event->term, $matches)) {
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 69fe25a2..2d013dc1 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -64,7 +64,7 @@ abstract class ShimmiePHPUnitTestCase extends \PHPUnit\Framework\TestCase
if (!$args) {
$args = [];
}
- foreach($args as $k=>$v) {
+ foreach ($args as $k=>$v) {
$args[$k] = (string)$v;
}
$_GET = [];