diff --git a/core/cacheengine.php b/core/cacheengine.php index 002b10b4..4d5fc05f 100644 --- a/core/cacheengine.php +++ b/core/cacheengine.php @@ -192,14 +192,14 @@ class Cache $_tracer->begin("Cache Query", ["key"=>$key]); $val = $this->engine->get($key); if ($val !== false) { - $res = "hit"; + $res = "hit"; $this->hits++; } else { - $res = "miss"; + $res = "miss"; $this->misses++; } $_tracer->end(null, ["result"=>$res]); - return $val; + return $val; } public function set(string $key, $val, int $time=0) diff --git a/core/config.php b/core/config.php index 6b1ac6fa..06047a77 100644 --- a/core/config.php +++ b/core/config.php @@ -159,7 +159,7 @@ abstract class BaseConfig implements Config public function set_array(string $name, ?array $value): void { - if($value!=null) { + if ($value!=null) { $this->values[$name] = implode(",", $value); } else { $this->values[$name] = null; @@ -313,16 +313,19 @@ class DatabaseConfig extends BaseConfig private $sub_column; private $sub_value; - public function __construct(Database $database, string $table_name = "config", - string $sub_column = null, string $sub_value = null) - { + public function __construct( + Database $database, + string $table_name = "config", + string $sub_column = null, + string $sub_value = null + ) { $this->database = $database; $this->table_name = $table_name; $this->sub_value = $sub_value; $this->sub_column = $sub_column; $cache_name = "config"; - if(!empty($sub_value)) { + if (!empty($sub_value)) { $cache_name .= "_".$sub_value; } @@ -335,12 +338,12 @@ class DatabaseConfig extends BaseConfig $query = "SELECT name, value FROM {$this->table_name}"; $args = []; - if(!empty($sub_column)&&!empty($sub_value)) { + if (!empty($sub_column)&&!empty($sub_value)) { $query .= " WHERE $sub_column = :sub_value"; $args["sub_value"] = $sub_value; } - foreach ($this->database->get_all($query, $args ) as $row) { + foreach ($this->database->get_all($query, $args) as $row) { $this->values[$row["name"]] = $row["value"]; } $this->database->cache->set($cache_name, $this->values); @@ -359,7 +362,7 @@ class DatabaseConfig extends BaseConfig $args = ["name"=>$name]; $cols = ["name","value"]; $params = [":name",":value"]; - if(!empty($this->sub_column)&&!empty($this->sub_value)) { + if (!empty($this->sub_column)&&!empty($this->sub_value)) { $query .= " AND $this->sub_column = :sub_value"; $args["sub_value"] = $this->sub_value; $cols[] = $this->sub_column; @@ -370,8 +373,9 @@ class DatabaseConfig extends BaseConfig $args["value"] =$this->values[$name]; $this->database->Execute( - "INSERT INTO {$this->table_name} (".join(",",$cols).") VALUES (".join(",",$params).")", - $args); + "INSERT INTO {$this->table_name} (".join(",", $cols).") VALUES (".join(",", $params).")", + $args + ); } // rather than deleting and having some other request(s) do a thundering // herd of race-conditioned updates, just save the updated version once here diff --git a/core/database.php b/core/database.php index 2cbf077f..3bead690 100644 --- a/core/database.php +++ b/core/database.php @@ -172,9 +172,9 @@ class Database if (is_null($this->engine)) { $this->connect_engine(); } - if($input===true) { + if ($input===true) { return $this->engine->BOOL_Y; - } else if ($input===false) { + } elseif ($input===false) { return $this->engine->BOOL_N; } return $input; @@ -190,13 +190,13 @@ class Database private function count_time(string $method, float $start, string $query, ?array $args): void { - global $_tracer, $tracer_enabled; - $dur = microtime(true) - $start; - if($tracer_enabled) { + global $_tracer, $tracer_enabled; + $dur = microtime(true) - $start; + if ($tracer_enabled) { $query = trim(preg_replace('/^[\t ]+/m', '', $query)); // trim leading whitespace $_tracer->complete($start * 1000000, $dur * 1000000, "DB Query", ["query"=>$query, "args"=>$args, "method"=>$method]); } - $this->query_count++; + $this->query_count++; $this->dbtime += $dur; } @@ -226,7 +226,7 @@ class Database return $stmt; } catch (PDOException $pdoe) { throw new SCoreException($pdoe->getMessage()."
Query: ".$query);
- }
+ }
}
/**
diff --git a/core/dbengine.php b/core/dbengine.php
index 5286a8ad..7c5112c0 100644
--- a/core/dbengine.php
+++ b/core/dbengine.php
@@ -1,5 +1,6 @@
theme = $this->get_theme_object($class);
$this->info = ExtensionInfo::get_for_extension_class($class);
- if($this->info===null) {
+ if ($this->info===null) {
throw new Exception("Info class not found for extension $class");
}
$this->key = $this->info->key;
@@ -132,14 +132,16 @@ abstract class Extension
public static function determine_enabled_extensions()
{
self::$enabled_extensions = [];
- foreach(array_merge(ExtensionInfo::get_core_extensions(),
- explode(",", EXTRA_EXTS)) as $key) {
+ foreach (array_merge(
+ ExtensionInfo::get_core_extensions(),
+ explode(",", EXTRA_EXTS)
+ ) as $key) {
$ext = ExtensionInfo::get_by_key($key);
- if($ext===null) {
+ if ($ext===null) {
continue;
}
self::$enabled_extensions[] = $ext->key;
- if(!empty($ext->dependencies)) {
+ if (!empty($ext->dependencies)) {
foreach ($ext->dependencies as $dep) {
self::$enabled_extensions[] = $dep;
}
@@ -158,7 +160,7 @@ abstract class Extension
}
public static function get_enabled_extensions_as_string(): string
{
- return implode(",",self::$enabled_extensions);
+ return implode(",", self::$enabled_extensions);
}
}
@@ -202,7 +204,7 @@ abstract class ExtensionInfo
public function is_supported(): bool
{
- if($this->supported===null) {
+ if ($this->supported===null) {
$this->check_support();
}
return $this->supported;
@@ -210,7 +212,7 @@ abstract class ExtensionInfo
public function get_support_info(): string
{
- if($this->supported===null) {
+ if ($this->supported===null) {
$this->check_support();
}
return $this->support_info;
@@ -222,22 +224,22 @@ abstract class ExtensionInfo
protected function __construct()
{
- if(empty($this->key)) {
+ if (empty($this->key)) {
throw new Exception("key field is required");
}
- if(empty($this->name)) {
+ if (empty($this->name)) {
throw new Exception("name field is required for extension $this->key");
}
- if(!empty($this->visibility)&&!in_array($this->visibility, self::VALID_VISIBILITY)) {
+ if (!empty($this->visibility)&&!in_array($this->visibility, self::VALID_VISIBILITY)) {
throw new Exception("Invalid visibility for extension $this->key");
}
- if(!is_array($this->db_support)) {
+ if (!is_array($this->db_support)) {
throw new Exception("db_support has to be an array for extension $this->key");
}
- if(!is_array($this->authors)) {
+ if (!is_array($this->authors)) {
throw new Exception("authors has to be an array for extension $this->key");
}
- if(!is_array($this->dependencies)) {
+ if (!is_array($this->dependencies)) {
throw new Exception("dependencies has to be an array for extension $this->key");
}
}
@@ -251,7 +253,7 @@ abstract class ExtensionInfo
{
global $database;
$this->support_info = "";
- if(!empty($this->db_support)&&!in_array($database->get_driver_name(), $this->db_support)) {
+ if (!empty($this->db_support)&&!in_array($database->get_driver_name(), $this->db_support)) {
$this->support_info .= "Database not supported. ";
}
// Additional checks here as needed
@@ -276,7 +278,7 @@ abstract class ExtensionInfo
public static function get_by_key(string $key): ?ExtensionInfo
{
- if(array_key_exists($key, self::$all_info_by_key)) {
+ if (array_key_exists($key, self::$all_info_by_key)) {
return self::$all_info_by_key[$key];
} else {
return null;
@@ -296,20 +298,19 @@ abstract class ExtensionInfo
public static function load_all_extension_info()
{
-
foreach (get_declared_classes() as $class) {
$rclass = new ReflectionClass($class);
if ($rclass->isAbstract()) {
// don't do anything
} elseif (is_subclass_of($class, "ExtensionInfo")) {
$extension_info = new $class();
- if(array_key_exists($extension_info->key, self::$all_info_by_key)) {
+ if (array_key_exists($extension_info->key, self::$all_info_by_key)) {
throw new Exception("Extension Info $class with key $extension_info->key has already been loaded");
}
self::$all_info_by_key[$extension_info->key] = $extension_info;
self::$all_info_by_class[$class] = $extension_info;
- if($extension_info->core===true) {
+ if ($extension_info->core===true) {
self::$core_extensions[] = $extension_info->key;
}
}
diff --git a/core/imageboard/image.php b/core/imageboard/image.php
index e798aeb6..bddfc23e 100644
--- a/core/imageboard/image.php
+++ b/core/imageboard/image.php
@@ -143,7 +143,7 @@ class Image
if (!$result) {
$querylet = Image::build_search_querylet($tag_conditions, $img_conditions);
$querylet->append(new Querylet(" ORDER BY ".(Image::$order_sql ?: "images.".$config->get_string("index_order"))));
- if($limit!=null) {
+ if ($limit!=null) {
$querylet->append(new Querylet(" LIMIT :limit ", ["limit" => $limit]));
}
$querylet->append(new Querylet(" OFFSET :offset ", ["offset"=>$start]));
@@ -231,7 +231,7 @@ class Image
$response = Image::query_accelerator($req);
if ($response) {
- $list = implode(",", $response);
+ $list = implode(",", $response);
$result = $database->execute("SELECT * FROM images WHERE id IN ($list) ORDER BY images.id DESC");
} else {
$result = $database->execute("SELECT * FROM images WHERE 1=0 ORDER BY images.id DESC");
@@ -256,19 +256,19 @@ class Image
public static function query_accelerator($req)
{
- global $_tracer;
+ global $_tracer;
$fp = @fsockopen("127.0.0.1", 21212);
if (!$fp) {
return null;
}
- $req_str = json_encode($req);
- $_tracer->begin("Accelerator Query", ["req"=>$req_str]);
+ $req_str = json_encode($req);
+ $_tracer->begin("Accelerator Query", ["req"=>$req_str]);
fwrite($fp, $req_str);
$data = "";
while (($buffer = fgets($fp, 4096)) !== false) {
$data .= $buffer;
}
- $_tracer->end();
+ $_tracer->end();
if (!feof($fp)) {
die("Error: unexpected fgets() fail in query_accelerator($req_str)\n");
}
@@ -833,10 +833,9 @@ class Image
$opts = $matches[2];
$post = $matches[3];
- if(isset($flexihashes[$opts])) {
+ if (isset($flexihashes[$opts])) {
$flexihash = $flexihashes[$opts];
- }
- else {
+ } else {
$flexihash = new Flexihash\Flexihash();
foreach (explode(",", $opts) as $opt) {
$parts = explode("=", $opt);
@@ -968,7 +967,7 @@ class Image
FROM images
WHERE 1=0
");
- } elseif($tag_count==1) {
+ } elseif ($tag_count==1) {
// All wildcard terms that qualify for a single tag can be treated the same as non-wildcards
$positive_tag_id_array[] = $tag_ids[0];
} else {
@@ -985,14 +984,14 @@ class Image
$sql = "";
assert($positive_tag_id_array || $positive_wildcard_id_array || $negative_tag_id_array, @$_GET['q']);
- if(!empty($positive_tag_id_array) || !empty($positive_wildcard_id_array)) {
+ if (!empty($positive_tag_id_array) || !empty($positive_wildcard_id_array)) {
$inner_joins = [];
if (!empty($positive_tag_id_array)) {
- foreach($positive_tag_id_array as $tag) {
+ foreach ($positive_tag_id_array as $tag) {
$inner_joins[] = "= $tag";
}
}
- if(!empty($positive_wildcard_id_array)) {
+ if (!empty($positive_wildcard_id_array)) {
foreach ($positive_wildcard_id_array as $tags) {
$positive_tag_id_list = join(', ', $tags);
$inner_joins[] = "IN ($positive_tag_id_list)";
@@ -1006,12 +1005,12 @@ class Image
$i++;
$sub_query .= " INNER JOIN image_tags it$i ON it$i.image_id = it.image_id AND it$i.tag_id $inner_join ";
}
- if(!empty($negative_tag_id_array)) {
+ if (!empty($negative_tag_id_array)) {
$negative_tag_id_list = join(', ', $negative_tag_id_array);
$sub_query .= " LEFT JOIN image_tags negative ON negative.image_id = it.image_id AND negative.tag_id IN ($negative_tag_id_list) ";
}
$sub_query .= "WHERE it.tag_id $first ";
- if(!empty($negative_tag_id_array)) {
+ if (!empty($negative_tag_id_array)) {
$sub_query .= " AND negative.image_id IS NULL";
}
$sub_query .= " GROUP BY it.image_id ";
@@ -1022,7 +1021,7 @@ class Image
$sub_query
) a on a.image_id = images.id
";
- } elseif(!empty($negative_tag_id_array)) {
+ } elseif (!empty($negative_tag_id_array)) {
$negative_tag_id_list = join(', ', $negative_tag_id_array);
$sql = "
SELECT images.*
diff --git a/core/imageboard/misc.php b/core/imageboard/misc.php
index c82d9f98..bead57bc 100644
--- a/core/imageboard/misc.php
+++ b/core/imageboard/misc.php
@@ -124,7 +124,7 @@ function get_thumbnail_size(int $orig_width, int $orig_height, bool $use_dpi_sca
}
- if($use_dpi_scaling) {
+ if ($use_dpi_scaling) {
list($max_width, $max_height) = get_thumbnail_max_size_scaled();
} else {
$max_width = $config->get_int(ImageConfig::THUMB_WIDTH);
@@ -138,7 +138,6 @@ function get_thumbnail_size(int $orig_width, int $orig_height, bool $use_dpi_sca
} else {
return $output;
}
-
}
function get_scaled_by_aspect_ratio(int $original_width, int $original_height, int $max_width, int $max_height) : array
@@ -167,19 +166,20 @@ function get_thumbnail_max_size_scaled(): array
}
-function create_image_thumb(string $hash, string $type, string $engine = null) {
+function create_image_thumb(string $hash, string $type, string $engine = null)
+{
global $config;
$inname = warehouse_path(Image::IMAGE_DIR, $hash);
$outname = warehouse_path(Image::THUMBNAIL_DIR, $hash);
$tsize = get_thumbnail_max_size_scaled();
- if(empty($engine)) {
+ if (empty($engine)) {
$engine = $config->get_string(ImageConfig::THUMB_ENGINE);
}
$output_format = $config->get_string(ImageConfig::THUMB_TYPE);
- if($output_format=="webp") {
+ if ($output_format=="webp") {
$output_format = Media::WEBP_LOSSY;
}
@@ -206,14 +206,14 @@ function format_milliseconds(int $input): string
$remainder = floor($input / 1000);
- foreach (TIME_UNITS AS $unit=>$conversion) {
+ foreach (TIME_UNITS as $unit=>$conversion) {
$count = $remainder % $conversion;
$remainder = floor($remainder / $conversion);
- if($count==0&&$remainder<1) {
+ if ($count==0&&$remainder<1) {
break;
}
$output = "$count".$unit." ".$output;
}
return trim($output);
-}
\ No newline at end of file
+}
diff --git a/core/page.php b/core/page.php
index 49bb0ec9..4b8c8f39 100644
--- a/core/page.php
+++ b/core/page.php
@@ -307,14 +307,14 @@ class Page
$active_link = null;
// To save on event calls, we check if one of the top-level links has already been marked as active
foreach ($nav_links as $link) {
- if($link->active===true) {
+ if ($link->active===true) {
$active_link = $link;
break;
}
}
$sub_links = null;
// If one is, we just query for sub-menu options under that one tab
- if($active_link!==null) {
+ if ($active_link!==null) {
$psnbe = new PageSubNavBuildingEvent($active_link->name);
send_event($psnbe);
$sub_links = $psnbe->links;
@@ -326,13 +326,13 @@ class Page
// Now we check for a current link so we can identify the sub-links to show
foreach ($psnbe->links as $sub_link) {
- if($sub_link->active===true) {
+ if ($sub_link->active===true) {
$sub_links = $psnbe->links;
break;
}
}
// If the active link has been detected, we break out
- if($sub_links!==null) {
+ if ($sub_links!==null) {
$link->active = true;
break;
}
@@ -372,7 +372,6 @@ class Page
header('Accept-Ranges: bytes');
if (isset($_SERVER['HTTP_RANGE'])) {
-
$c_start = $start;
$c_end = $end;
list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
@@ -418,8 +417,9 @@ class Page
// After flush, we can tell if the client browser has disconnected.
// This means we can start sending a large file, and if we detect they disappeared
// then we can just stop and not waste any more resources or bandwidth.
- if (connection_status() != 0)
+ if (connection_status() != 0) {
break;
+ }
}
} finally {
fclose($fp);
@@ -541,7 +541,7 @@ class PageSubNavBuildingEvent extends Event
public function add_nav_link(string $name, Link $link, string $desc, ?bool $active = null, int $order = 50)
{
- $this->links[] = new NavLink($name, $link, $desc, $active,$order);
+ $this->links[] = new NavLink($name, $link, $desc, $active, $order);
}
}
@@ -553,7 +553,7 @@ class NavLink
public $order;
public $active = false;
- public function __construct(String $name, Link $link, String $description, ?bool $active = null, int $order = 50)
+ public function __construct(String $name, Link $link, String $description, ?bool $active = null, int $order = 50)
{
global $config;
@@ -561,7 +561,7 @@ class NavLink
$this->link = $link;
$this->description = $description;
$this->order = $order;
- if($active==null) {
+ if ($active==null) {
$query = ltrim(_get_query(), "/");
if ($query === "") {
// This indicates the front page, so we check what's set as the front page
@@ -572,15 +572,14 @@ class NavLink
} else {
$this->active = self::is_active([$link->page], $front_page);
}
- } elseif($query===$link->page) {
+ } elseif ($query===$link->page) {
$this->active = true;
- }else {
+ } else {
$this->active = self::is_active([$link->page]);
}
} else {
$this->active = $active;
}
-
}
public static function is_active(array $pages_matched, string $url = null): bool
diff --git a/core/permissions.php b/core/permissions.php
index 4378a9c0..717bd5fd 100644
--- a/core/permissions.php
+++ b/core/permissions.php
@@ -66,5 +66,4 @@ abstract class Permissions
public const VIEW_TRASH = "view_trash";
public const PERFORM_BULK_ACTIONS = "perform_bulk_actions";
-
-}
\ No newline at end of file
+}
diff --git a/core/polyfills.php b/core/polyfills.php
index 2741e5f9..a007c984 100644
--- a/core/polyfills.php
+++ b/core/polyfills.php
@@ -759,7 +759,7 @@ function validate_input(array $inputs): array
*/
function sanitize_path(string $path): string
{
- return preg_replace('|[\\\\/]+|S',DIRECTORY_SEPARATOR,$path);
+ return preg_replace('|[\\\\/]+|S', DIRECTORY_SEPARATOR, $path);
}
/**
@@ -770,11 +770,11 @@ function join_path(string ...$paths): string
{
$output = "";
foreach ($paths as $path) {
- if(empty($path)) {
+ if (empty($path)) {
continue;
}
$path = sanitize_path($path);
- if(empty($output)) {
+ if (empty($output)) {
$output = $path;
} else {
$output = rtrim($output, DIRECTORY_SEPARATOR);
@@ -790,8 +790,8 @@ function join_path(string ...$paths): string
*/
function iterator_map(callable $callback, iterator $iter): Generator
{
- foreach($iter as $i) {
- yield call_user_func($callback,$i);
+ foreach ($iter as $i) {
+ yield call_user_func($callback, $i);
}
}
@@ -810,12 +810,16 @@ function get_class_from_file(string $file): string
$class = $buffer = '';
$i = 0;
while (!$class) {
- if (feof($fp)) break;
+ if (feof($fp)) {
+ break;
+ }
$buffer .= fread($fp, 512);
$tokens = token_get_all($buffer);
- if (strpos($buffer, '{') === false) continue;
+ if (strpos($buffer, '{') === false) {
+ continue;
+ }
for (;$i Returns images that have been commented on by user 123. Images are stored in /ext/emoticons/default/, and you can
add more emoticons by uploading images into that folder.";
}
-
diff --git a/ext/emoticons/main.php b/ext/emoticons/main.php
index 422c7610..73d5bee2 100644
--- a/ext/emoticons/main.php
+++ b/ext/emoticons/main.php
@@ -18,4 +18,3 @@ class Emoticons extends FormatterExtension
return $text;
}
}
-
diff --git a/ext/et/main.php b/ext/et/main.php
index f4f058d4..db7851be 100644
--- a/ext/et/main.php
+++ b/ext/et/main.php
@@ -16,7 +16,7 @@ class ET extends Extension
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
global $user;
- if($event->parent==="system") {
+ if ($event->parent==="system") {
if ($user->can(Permissions::VIEW_SYSINTO)) {
$event->add_nav_link("system_info", new Link('system_info'), "System Info", null, 10);
}
diff --git a/ext/ext_manager/main.php b/ext/ext_manager/main.php
index acb51ca3..8a4add73 100644
--- a/ext/ext_manager/main.php
+++ b/ext/ext_manager/main.php
@@ -3,10 +3,12 @@
function __extman_extcmp(ExtensionInfo $a, ExtensionInfo $b): int
{
- if($a->beta===true&&$b->beta===false)
+ if ($a->beta===true&&$b->beta===false) {
return 1;
- if($a->beta===false&&$b->beta===true)
+ }
+ if ($a->beta===false&&$b->beta===true) {
return -1;
+ }
return strcmp($a->name, $b->name);
}
@@ -82,7 +84,7 @@ class ExtManager extends Extension
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
global $user;
- if($event->parent==="system") {
+ if ($event->parent==="system") {
if ($user->can(Permissions::MANAGE_EXTENSION_LIST)) {
$event->add_nav_link("ext_manager", new Link('ext_manager'), "Extension Manager");
} else {
@@ -108,7 +110,7 @@ class ExtManager extends Extension
{
$extensions = ExtensionInfo::get_all();
if (!$all) {
- $extensions = array_filter($extensions,"__extman_extactive");
+ $extensions = array_filter($extensions, "__extman_extactive");
}
usort($extensions, "__extman_extcmp");
return $extensions;
diff --git a/ext/ext_manager/theme.php b/ext/ext_manager/theme.php
index 6a19757e..27cc896b 100644
--- a/ext/ext_manager/theme.php
+++ b/ext/ext_manager/theme.php
@@ -32,7 +32,7 @@ class ExtManagerTheme extends Themelet
$h_link = make_link("ext_doc/" . url_escape($extension->key));
$h_enabled = ($extension->is_enabled() === true ? " checked='checked'" : "");
- $h_disabled = ($extension->is_supported()===false || $extension->core===true? " disabled ": " " );
+ $h_disabled = ($extension->is_supported()===false || $extension->core===true? " disabled ": " ");
//baseline_open_in_new_black_18dp.png
diff --git a/ext/favorites/main.php b/ext/favorites/main.php
index 03d93a3e..cd246b32 100644
--- a/ext/favorites/main.php
+++ b/ext/favorites/main.php
@@ -144,7 +144,7 @@ class Favorites extends Extension
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
{
- if($event->key===HelpPages::SEARCH) {
+ if ($event->key===HelpPages::SEARCH) {
$block = new Block();
$block->header = "Favorites";
$block->body = $this->theme->get_help_html();
@@ -155,11 +155,11 @@ class Favorites extends Extension
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
global $user;
- if($event->parent=="posts") {
+ if ($event->parent=="posts") {
$event->add_nav_link("posts_favorites", new Link("post/list/favorited_by={$user->name}/1"), "My Favorites");
}
- if($event->parent==="user") {
+ if ($event->parent==="user") {
if ($user->can(Permissions::MANAGE_ADMINTOOLS)) {
$username = url_escape($user->name);
$event->add_nav_link("favorites", new Link("post/list/favorited_by=$username/1"), "My Favorites");
diff --git a/ext/favorites/theme.php b/ext/favorites/theme.php
index 22367347..cd03afbb 100644
--- a/ext/favorites/theme.php
+++ b/ext/favorites/theme.php
@@ -56,6 +56,5 @@ class FavoritesTheme extends Themelet
Returns images that have been favorited by user 123. " . $this->theme->build_thumb_html($duplicate);
throw new ImageReplaceException($error);
@@ -361,8 +359,8 @@ class ImageIO extends Extension
try {
Media::update_image_media_properties($image->hash, $image->ext);
- } catch(MediaException $e) {
- log_warning("image_replace","Error while running update_image_media_properties: ".$e->getMessage());
+ } catch (MediaException $e) {
+ log_warning("image_replace", "Error while running update_image_media_properties: ".$e->getMessage());
}
/* Generate new thumbnail */
diff --git a/ext/image_hash_ban/main.php b/ext/image_hash_ban/main.php
index eff69872..33ff65d5 100644
--- a/ext/image_hash_ban/main.php
+++ b/ext/image_hash_ban/main.php
@@ -97,7 +97,7 @@ class ImageBan extends Extension
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
global $user;
- if($event->parent==="system") {
+ if ($event->parent==="system") {
if ($user->can(Permissions::BAN_IMAGE)) {
$event->add_nav_link("image_bans", new Link('image_hash_ban/list/1'), "Image Bans", NavLink::is_active(["image_hash_ban"]));
}
diff --git a/ext/index/main.php b/ext/index/main.php
index 0ce1b745..5d136b20 100644
--- a/ext/index/main.php
+++ b/ext/index/main.php
@@ -108,10 +108,13 @@ class Index extends Extension
if (SPEED_HAX) {
if (!$user->can("big_search")) {
$fast_page_limit = 500;
- if ($total_pages > $fast_page_limit) $total_pages = $fast_page_limit;
+ if ($total_pages > $fast_page_limit) {
+ $total_pages = $fast_page_limit;
+ }
if ($page_number > $fast_page_limit) {
$this->theme->display_error(
- 404, "Search limit hit",
+ 404,
+ "Search limit hit",
"Only $fast_page_limit pages of results are searchable - " .
"if you want to find older results, use more specific search terms"
);
@@ -180,19 +183,19 @@ class Index extends Extension
public function onPageNavBuilding(PageNavBuildingEvent $event)
{
- $event->add_nav_link("posts", new Link('post/list'), "Posts", NavLink::is_active(["post","view"]),20);
+ $event->add_nav_link("posts", new Link('post/list'), "Posts", NavLink::is_active(["post","view"]), 20);
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
- if($event->parent=="posts") {
+ if ($event->parent=="posts") {
$event->add_nav_link("posts_all", new Link('post/list'), "All");
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
{
- if($event->key===HelpPages::SEARCH) {
+ if ($event->key===HelpPages::SEARCH) {
$block = new Block();
$block->header = "General";
$block->body = $this->theme->get_help_html();
diff --git a/ext/index/theme.php b/ext/index/theme.php
index e216ea06..8c881afd 100644
--- a/ext/index/theme.php
+++ b/ext/index/theme.php
@@ -339,6 +339,5 @@ and of course start organising your images :-)
These search terms depend on the items being scanned for media content. Automatic scanning was implemented in mid-2019, so items uploaded before, or items uploaded on a system without ffmpeg, will require additional scanning before this will work. Returns images with note(s) by user 123. Sorts the search results by score, ascending. Returns images in the "swimming pool" pool. Note that the underscore becomes a space Returns images that have no children. Can use <, <=, >, >=, or =. Category name is not case sensitive, category must exist for search to work. Returns images that are in the trash.
";
}
if (class_exists("ImageBan")) {
@@ -75,6 +74,4 @@ class AdminPageTheme extends Themelet
";
return $html;
}
-
-
}
diff --git a/ext/alias_editor/main.php b/ext/alias_editor/main.php
index 537b0e63..ad50a464 100644
--- a/ext/alias_editor/main.php
+++ b/ext/alias_editor/main.php
@@ -109,7 +109,7 @@ class AliasEditor extends Extension
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
- if($event->parent=="tags") {
+ if ($event->parent=="tags") {
$event->add_nav_link("aliases", new Link('alias/list'), "Aliases", NavLink::is_active(["alias"]));
}
}
diff --git a/ext/artists/main.php b/ext/artists/main.php
index 64d42acb..a8fd92d8 100644
--- a/ext/artists/main.php
+++ b/ext/artists/main.php
@@ -47,7 +47,7 @@ class Artists extends Extension
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
{
- if($event->key===HelpPages::SEARCH) {
+ if ($event->key===HelpPages::SEARCH) {
$block = new Block();
$block->header = "Artist";
$block->body = $this->theme->get_help_html();
diff --git a/ext/autocomplete/main.php b/ext/autocomplete/main.php
index 80344672..48d862c4 100644
--- a/ext/autocomplete/main.php
+++ b/ext/autocomplete/main.php
@@ -33,8 +33,8 @@ class AutoComplete extends Extension
//$limit = 0;
$cache_key = "autocomplete-$s";
$limitSQL = "";
- $s = str_replace('_','\_', $s);
- $s = str_replace('%','\%', $s);
+ $s = str_replace('_', '\_', $s);
+ $s = str_replace('%', '\%', $s);
$SQLarr = ["search"=>"$s%"]; #, "cat_search"=>"%:$s%"];
if (isset($_GET["limit"]) && $_GET["limit"] !== 0) {
$limitSQL = "LIMIT :limit";
diff --git a/ext/blocks/main.php b/ext/blocks/main.php
index b172f201..de2c2ab9 100644
--- a/ext/blocks/main.php
+++ b/ext/blocks/main.php
@@ -22,7 +22,7 @@ class Blocks extends Extension
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
global $user;
- if($event->parent==="system") {
+ if ($event->parent==="system") {
if ($user->can(Permissions::MANAGE_BLOCKS)) {
$event->add_nav_link("blocks", new Link('blocks/list'), "Blocks Editor");
}
diff --git a/ext/blotter/main.php b/ext/blotter/main.php
index 12f70fc7..50b7a090 100644
--- a/ext/blotter/main.php
+++ b/ext/blotter/main.php
@@ -51,7 +51,7 @@ class Blotter extends Extension
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
global $user;
- if($event->parent==="system") {
+ if ($event->parent==="system") {
if ($user->is_admin()) {
$event->add_nav_link("blotter", new Link('blotter/editor'), "Blotter Editor");
}
diff --git a/ext/bulk_actions/main.php b/ext/bulk_actions/main.php
index 9ccd5e74..dbae2b4c 100644
--- a/ext/bulk_actions/main.php
+++ b/ext/bulk_actions/main.php
@@ -13,10 +13,10 @@ class BulkActionBlockBuildingEvent extends Event
$block = "";
}
- if(!empty($access_key)) {
+ if (!empty($access_key)) {
assert(strlen($access_key)==1);
foreach ($this->actions as $existing) {
- if($existing["access_key"]==$access_key) {
+ if ($existing["access_key"]==$access_key) {
throw new SCoreException("Access key $access_key is already in use");
}
}
@@ -81,18 +81,18 @@ class BulkActions extends Extension
}
if ($user->can(Permissions::BULK_EDIT_IMAGE_TAG)) {
-
$event->add_action(
"bulk_tag",
"Tag",
"t",
"",
$this->theme->render_tag_input(),
- 10);
+ 10
+ );
}
if ($user->can(Permissions::BULK_EDIT_IMAGE_SOURCE)) {
- $event->add_action("bulk_source", "Set (S)ource", "s","", $this->theme->render_source_input(), 10);
+ $event->add_action("bulk_source", "Set (S)ource", "s", "", $this->theme->render_source_input(), 10);
}
}
@@ -177,7 +177,7 @@ class BulkActions extends Extension
foreach ($data as $id) {
if (is_numeric($id)) {
$image = Image::by_id($id);
- if($image!=null) {
+ if ($image!=null) {
yield $image;
}
}
@@ -237,10 +237,10 @@ class BulkActions extends Extension
}
} else {
foreach ($items as $image) {
- $img_tags = array_map("strtolower",$image->get_tag_array());
+ $img_tags = array_map("strtolower", $image->get_tag_array());
if (!empty($neg_tag_array)) {
- $neg_tag_array = array_map("strtolower",$neg_tag_array);
+ $neg_tag_array = array_map("strtolower", $neg_tag_array);
$img_tags = array_merge($pos_tag_array, $img_tags);
$img_tags = array_diff($img_tags, $neg_tag_array);
diff --git a/ext/comment/main.php b/ext/comment/main.php
index 619f355e..1df53617 100644
--- a/ext/comment/main.php
+++ b/ext/comment/main.php
@@ -157,7 +157,7 @@ class CommentList extends Extension
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
- if($event->parent=="comment") {
+ if ($event->parent=="comment") {
$event->add_nav_link("comment_list", new Link('comment/list'), "All");
$event->add_nav_link("comment_help", new Link('ext_doc/comment'), "Help");
}
@@ -359,7 +359,7 @@ class CommentList extends Extension
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
{
- if($event->key===HelpPages::SEARCH) {
+ if ($event->key===HelpPages::SEARCH) {
$block = new Block();
$block->header = "Comments";
$block->body = $this->theme->get_help_html();
diff --git a/ext/comment/theme.php b/ext/comment/theme.php
index 7e62da6b..31b77a7d 100644
--- a/ext/comment/theme.php
+++ b/ext/comment/theme.php
@@ -312,6 +312,5 @@ class CommentListTheme extends Themelet
GNU GENERAL PUBLIC LICENSE
+ $block = new Block(ExtensionInfo::LICENSE_GPLV2);
+ $block->body = "
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
@@ -432,10 +430,10 @@ proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
";
- $event->add_block($block);
+ $event->add_block($block);
- $block = new Block(ExtensionInfo::LICENSE_MIT);
- $block->body = "Permission is hereby granted, free of charge, to any person obtaining a copy
+ $block = new Block(ExtensionInfo::LICENSE_MIT);
+ $block->body = "
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the \"Software\"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -452,11 +450,11 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
";
- $event->add_block($block);
+ $event->add_block($block);
- $block = new Block(ExtensionInfo::LICENSE_WTFPL);
- $block->body = " DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ $block = new Block(ExtensionInfo::LICENSE_WTFPL);
+ $block->body = "
";
- $event->add_block($block);
-
+ $event->add_block($block);
+ }
}
- }
-
}
diff --git a/ext/help_pages/theme.php b/ext/help_pages/theme.php
index 2b3b7818..15892fb0 100644
--- a/ext/help_pages/theme.php
+++ b/ext/help_pages/theme.php
@@ -2,7 +2,6 @@
class HelpPagesTheme extends Themelet
{
-
public function display_list_page(array $pages)
{
global $page;
@@ -27,5 +26,4 @@ class HelpPagesTheme extends Themelet
$page->set_title("Help - $title");
$page->set_heading("Help - $title");
}
-
}
diff --git a/ext/image/config.php b/ext/image/config.php
index 7bcaf8c5..4a4a4cc3 100644
--- a/ext/image/config.php
+++ b/ext/image/config.php
@@ -1,6 +1,7 @@
ImageConfig::COLLISION_ERROR, 'Merge'=>ImageConfig::COLLISION_MERGE];
const EXIF_READ_FUNCTION = "exif_read_data";
@@ -240,10 +239,9 @@ class ImageIO extends Extension
try {
Media::update_image_media_properties($image->hash, strtolower($image->ext));
- } catch(MediaException $e) {
- log_warning("add_image","Error while running update_image_media_properties: ".$e->getMessage());
+ } catch (MediaException $e) {
+ log_warning("add_image", "Error while running update_image_media_properties: ".$e->getMessage());
}
-
}
// }}} end add
@@ -322,7 +320,7 @@ class ImageIO extends Extension
$duplicate = Image::by_hash($image->hash);
- if(!is_null($duplicate) && $duplicate->id!=$id) {
+ if (!is_null($duplicate) && $duplicate->id!=$id) {
$error = "Image {$duplicate->id} " .
"already has hash {$image->hash}: DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar
";
0. You just DO WHAT THE FUCK YOU WANT TO.
Title
diff --git a/ext/random_image/main.php b/ext/random_image/main.php
index 9646bc5e..bed04fba 100644
--- a/ext/random_image/main.php
+++ b/ext/random_image/main.php
@@ -58,7 +58,7 @@ class RandomImage extends Extension
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
- if($event->parent=="posts") {
+ if ($event->parent=="posts") {
$event->add_nav_link("posts_random", new Link('random_image/view'), "Random Image");
}
}
diff --git a/ext/random_list/main.php b/ext/random_list/main.php
index f5c13976..7de02acf 100644
--- a/ext/random_list/main.php
+++ b/ext/random_list/main.php
@@ -67,7 +67,7 @@ class RandomList extends Extension
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
- if($event->parent=="posts") {
+ if ($event->parent=="posts") {
$event->add_nav_link("posts_random", new Link('random'), "Shuffle");
}
}
diff --git a/ext/rating/main.php b/ext/rating/main.php
index 7c11a2e2..f9e5ca83 100644
--- a/ext/rating/main.php
+++ b/ext/rating/main.php
@@ -109,7 +109,7 @@ class Ratings extends Extension
{
global $user;
- if($event->key===HelpPages::SEARCH) {
+ if ($event->key===HelpPages::SEARCH) {
$block = new Block();
$block->header = "Ratings";
@@ -164,7 +164,7 @@ class Ratings extends Extension
global $user;
if ($user->can(Permissions::BULK_EDIT_IMAGE_RATING)) {
- $event->add_action("bulk_rate","Set (R)ating", "r","",$this->theme->get_selection_rater_html("u","bulk_rating"));
+ $event->add_action("bulk_rate", "Set (R)ating", "r", "", $this->theme->get_selection_rater_html("u", "bulk_rating"));
}
}
diff --git a/ext/regen_thumb/main.php b/ext/regen_thumb/main.php
index 59acbc99..f20c6dde 100644
--- a/ext/regen_thumb/main.php
+++ b/ext/regen_thumb/main.php
@@ -57,7 +57,7 @@ class RegenThumb extends Extension
global $user;
if ($user->can(Permissions::DELETE_IMAGE)) {
- $event->add_action("bulk_regen", "Regen Thumbnails", "","", $this->theme->bulk_html());
+ $event->add_action("bulk_regen", "Regen Thumbnails", "", "", $this->theme->bulk_html());
}
}
diff --git a/ext/relationships/main.php b/ext/relationships/main.php
index 2a0eb2d5..3cdee74f 100644
--- a/ext/relationships/main.php
+++ b/ext/relationships/main.php
@@ -6,7 +6,7 @@ class ImageRelationshipSetEvent extends Event
public $parent_id;
- public function __construct(int $child_id, int $parent_id)
+ public function __construct(int $child_id, int $parent_id)
{
$this->child_id = $child_id;
$this->parent_id = $parent_id;
@@ -44,7 +44,7 @@ class Relationships extends Extension
{
if (isset($_POST['tag_edit__tags']) ? !preg_match('/parent[=|:]/', $_POST["tag_edit__tags"]) : true) { //Ignore tag_edit__parent if tags contain parent metatag
if (isset($_POST["tag_edit__parent"]) ? ctype_digit($_POST["tag_edit__parent"]) : false) {
- send_event(new ImageRelationshipSetEvent($event->image->id,(int) $_POST["tag_edit__parent"]));
+ send_event(new ImageRelationshipSetEvent($event->image->id, (int) $_POST["tag_edit__parent"]));
} else {
$this->remove_parent($event->image->id);
}
@@ -76,7 +76,7 @@ class Relationships extends Extension
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
{
- if($event->key===HelpPages::SEARCH) {
+ if ($event->key===HelpPages::SEARCH) {
$block = new Block();
$block->header = "Relationships";
$block->body = $this->theme->get_help_html();
@@ -132,15 +132,14 @@ class Relationships extends Extension
$old_parent = $database->get_one("SELECT parent_id FROM images WHERE id = :cid", ["cid"=>$event->child_id]);
- if($old_parent!=$event->parent_id) {
+ if ($old_parent!=$event->parent_id) {
if ($database->get_row("SELECT 1 FROM images WHERE id = :pid", ["pid" => $event->parent_id])) {
-
$result = $database->execute("UPDATE images SET parent_id = :pid WHERE id = :cid", ["pid" => $event->parent_id, "cid" => $event->child_id]);
if ($result->rowCount() > 0) {
$database->execute("UPDATE images SET has_children = TRUE WHERE id = :pid", ["pid" => $event->parent_id]);
- if($old_parent!=null) {
+ if ($old_parent!=null) {
$this->set_has_children($old_parent);
}
}
@@ -155,7 +154,7 @@ class Relationships extends Extension
$results = $database->get_all_iterable("SELECT * FROM images WHERE parent_id = :pid ", ["pid"=>$image->id]);
$output = [];
foreach ($results as $result) {
- if($result["id"]==$omit) {
+ if ($result["id"]==$omit) {
continue;
}
$output[] = new Image($result);
@@ -180,13 +179,11 @@ class Relationships extends Extension
// Doesn't work on pgsql
// $database->execute("UPDATE images SET has_children = (SELECT * FROM (SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM images WHERE parent_id = :pid) AS sub)
-// WHERE id = :pid", ["pid"=>$parentID]);
+ // WHERE id = :pid", ["pid"=>$parentID]);
$database->execute(
"UPDATE images SET has_children = EXISTS (SELECT 1 FROM images WHERE parent_id = :pid) WHERE id = :pid",
- ["pid"=>$parent_id]);
+ ["pid"=>$parent_id]
+ );
}
-
-
-
}
diff --git a/ext/relationships/test.php b/ext/relationships/test.php
index b486378a..69c1bbd1 100644
--- a/ext/relationships/test.php
+++ b/ext/relationships/test.php
@@ -34,7 +34,7 @@ class RelationshipTest extends ShimmiePHPUnitTestCase
$image_3 = Image::by_id($image_id_3);
$this->assertNull($image_1->parent_id);
- $this->assertEquals($image_id_1,$image_2->parent_id);
+ $this->assertEquals($image_id_1, $image_2->parent_id);
$this->assertNull($image_3->parent_id);
$this->assertTrue($image_1->has_children);
$this->assertFalse($image_2->has_children);
@@ -56,7 +56,7 @@ class RelationshipTest extends ShimmiePHPUnitTestCase
$image_3 = Image::by_id($image_id_3);
$this->assertNull($image_1->parent_id);
- $this->assertEquals($image_id_3,$image_2->parent_id);
+ $this->assertEquals($image_id_3, $image_2->parent_id);
$this->assertNull($image_3->parent_id);
$this->assertFalse($image_2->has_children);
$this->assertFalse($image_2->has_children);
@@ -129,7 +129,7 @@ class RelationshipTest extends ShimmiePHPUnitTestCase
$image_3 = Image::by_id($image_id_3);
$this->assertNull($image_1->parent_id);
- $this->assertEquals($image_id_1,$image_2->parent_id);
+ $this->assertEquals($image_id_1, $image_2->parent_id);
$this->assertNull($image_3->parent_id);
$this->assertTrue($image_1->has_children);
$this->assertFalse($image_2->has_children);
@@ -151,8 +151,8 @@ class RelationshipTest extends ShimmiePHPUnitTestCase
$image_2 = Image::by_id($image_id_2);
$image_3 = Image::by_id($image_id_3);
- $this->assertEquals($image_id_3,$image_1->parent_id);
- $this->assertEquals($image_id_1,$image_2->parent_id);
+ $this->assertEquals($image_id_3, $image_1->parent_id);
+ $this->assertEquals($image_id_1, $image_2->parent_id);
$this->assertNull($image_3->parent_id);
$this->assertTrue($image_1->has_children);
$this->assertFalse($image_2->has_children);
@@ -175,7 +175,7 @@ class RelationshipTest extends ShimmiePHPUnitTestCase
$image_3 = Image::by_id($image_id_3);
$this->assertNull($image_1->parent_id);
- $this->assertEquals($image_id_1,$image_2->parent_id);
+ $this->assertEquals($image_id_1, $image_2->parent_id);
$this->assertNull($image_3->parent_id);
$this->assertTrue($image_1->has_children);
$this->assertFalse($image_2->has_children);
diff --git a/ext/relationships/theme.php b/ext/relationships/theme.php
index 40c0fe8c..b1af3843 100644
--- a/ext/relationships/theme.php
+++ b/ext/relationships/theme.php
@@ -72,6 +72,5 @@ class RelationshipsTheme extends Themelet
", $stats), "main", 10));
-
}
public function build_options(User $duser, UserOptionsBuildingEvent $event)
@@ -337,7 +336,6 @@ class UserPageTheme extends Themelet
foreach ($event->parts as $part) {
$html .= $part;
}
-
}
return $html;
}
diff --git a/ext/user_config/main.php b/ext/user_config/main.php
index a07b28d1..91aa375e 100644
--- a/ext/user_config/main.php
+++ b/ext/user_config/main.php
@@ -26,7 +26,7 @@ class UserConfig extends Extension
{
global $config;
- if ($config->get_int(self::VERSION,0)<1) {
+ if ($config->get_int(self::VERSION, 0)<1) {
$this->install();
}
}
@@ -43,8 +43,7 @@ class UserConfig extends Extension
{
global $config, $database;
- if ($config->get_int(self::VERSION,0) < 1) {
-
+ if ($config->get_int(self::VERSION, 0) < 1) {
log_info("upgrade", "Adding user config table");
$database->create_table("user_config", "
diff --git a/ext/view/events/displaying_image_event.php b/ext/view/events/displaying_image_event.php
index 75f4462b..872e425e 100644
--- a/ext/view/events/displaying_image_event.php
+++ b/ext/view/events/displaying_image_event.php
@@ -26,7 +26,8 @@ class DisplayingImageEvent extends Event
return $this->image;
}
- public function set_title(String $title) {
+ public function set_title(String $title)
+ {
$this->title = $title;
}
}
diff --git a/ext/view/events/image_admin_block_building_event.php b/ext/view/events/image_admin_block_building_event.php
index 0211065a..971fe97e 100644
--- a/ext/view/events/image_admin_block_building_event.php
+++ b/ext/view/events/image_admin_block_building_event.php
@@ -22,4 +22,4 @@ class ImageAdminBlockBuildingEvent extends Event
}
$this->parts[$position] = $html;
}
-}
\ No newline at end of file
+}
diff --git a/ext/view/events/image_info_box_building_event.php b/ext/view/events/image_info_box_building_event.php
index cb626349..61577490 100644
--- a/ext/view/events/image_info_box_building_event.php
+++ b/ext/view/events/image_info_box_building_event.php
@@ -22,4 +22,4 @@ class ImageInfoBoxBuildingEvent extends Event
}
$this->parts[$position] = $html;
}
-}
\ No newline at end of file
+}
diff --git a/ext/view/events/image_info_set_event.php b/ext/view/events/image_info_set_event.php
index e6d77d59..a870f328 100644
--- a/ext/view/events/image_info_set_event.php
+++ b/ext/view/events/image_info_set_event.php
@@ -9,4 +9,4 @@ class ImageInfoSetEvent extends Event
{
$this->image = $image;
}
-}
\ No newline at end of file
+}
diff --git a/ext/wiki/main.php b/ext/wiki/main.php
index cf992659..db339f76 100644
--- a/ext/wiki/main.php
+++ b/ext/wiki/main.php
@@ -171,13 +171,13 @@ class Wiki extends Extension
public function onPageNavBuilding(PageNavBuildingEvent $event)
{
- $event->add_nav_link("wiki",new Link('wiki'), "Wiki");
+ $event->add_nav_link("wiki", new Link('wiki'), "Wiki");
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
- if($event->parent=="wiki") {
+ if ($event->parent=="wiki") {
$event->add_nav_link("wiki_rules", new Link('wiki/rules'), "Rules");
$event->add_nav_link("wiki_help", new Link('ext_doc/wiki'), "Help");
}
diff --git a/index.php b/index.php
index 0001f5d5..ffcc1355 100644
--- a/index.php
+++ b/index.php
@@ -100,7 +100,7 @@ try {
$page->display();
}
- if($database->transaction===true) {
+ if ($database->transaction===true) {
$database->commit();
}
@@ -117,7 +117,7 @@ try {
$_tracer->end();
if (TRACE_FILE) {
- if((microtime(true) - $_shm_load_start) > TRACE_THRESHOLD) {
- $_tracer->flush(TRACE_FILE);
- }
+ if ((microtime(true) - $_shm_load_start) > TRACE_THRESHOLD) {
+ $_tracer->flush(TRACE_FILE);
+ }
}
diff --git a/themes/danbooru/layout.class.php b/themes/danbooru/layout.class.php
index 6be406a4..68c315f1 100644
--- a/themes/danbooru/layout.class.php
+++ b/themes/danbooru/layout.class.php
@@ -101,7 +101,7 @@ class Layout
}
$custom_sublinks = "";
- if(!empty($sub_links)) {
+ if (!empty($sub_links)) {
$custom_sublinks = "