diff --git a/config/iso3166.json b/config/iso3166.json index 7e52d99..1ab47a4 100644 --- a/config/iso3166.json +++ b/config/iso3166.json @@ -14,7 +14,7 @@ "AT": "Austria", "AU": "Australia", "AW": "Aruba", - "AX": "Åland Islands", + "AX": "Ã…land Islands", "AZ": "Azerbaijan", "BA": "Bosnia and Herzegovina", "BB": "Barbados", @@ -25,7 +25,7 @@ "BH": "Bahrain", "BI": "Burundi", "BJ": "Benin", - "BL": "Saint Barthélemy", + "BL": "Saint Barthélemy", "BM": "Bermuda", "BN": "Brunei Darussalam", "BO": "Plurinational State of Bolivia", @@ -43,7 +43,7 @@ "CF": "Central African Republic", "CG": "Congo", "CH": "Switzerland", - "CI": "Côte d'Ivoire", + "CI": "Côte d'Ivoire", "CK": "Cook Islands", "CL": "Chile", "CM": "Cameroon", @@ -52,7 +52,7 @@ "CR": "Costa Rica", "CU": "Cuba", "CV": "Cabo Verde", - "CW": "Curaçao", + "CW": "Curaçao", "CX": "Christmas Island", "CY": "Cyprus", "CZ": "Czech Republic", @@ -187,7 +187,7 @@ "PW": "Palau", "PY": "Paraguay", "QA": "Qatar", - "RE": "Réunion", + "RE": "Réunion", "RO": "Romania", "RS": "Serbia", "RU": "Russian Federation", diff --git a/libraries/BBcode.php b/libraries/BBcode.php index 1f7730d..d4e62c9 100644 --- a/libraries/BBcode.php +++ b/libraries/BBcode.php @@ -126,7 +126,7 @@ class BBcode public static function text($text) { // Check if $bbcode is still null - if (self::$bbcode == null) { + if (!self::$bbcode) { self::init(); } diff --git a/libraries/BBcodeDefinitions/Align.php b/libraries/BBcodeDefinitions/Align.php index e2e1f50..5abfff8 100644 --- a/libraries/BBcodeDefinitions/Align.php +++ b/libraries/BBcodeDefinitions/Align.php @@ -7,7 +7,6 @@ namespace Sakura\BBcodeDefinitions; -use JBBCode\Parser; use JBBCode\CodeDefinition; use JBBCode\ElementNode; diff --git a/libraries/BBcodeDefinitions/Code.php b/libraries/BBcodeDefinitions/Code.php index 314b24b..1c61dc2 100644 --- a/libraries/BBcodeDefinitions/Code.php +++ b/libraries/BBcodeDefinitions/Code.php @@ -7,7 +7,6 @@ namespace Sakura\BBcodeDefinitions; -use JBBCode\Parser; use JBBCode\CodeDefinition; use JBBCode\ElementNode; diff --git a/libraries/BBcodeDefinitions/Lists.php b/libraries/BBcodeDefinitions/Lists.php index 7356051..c46703a 100644 --- a/libraries/BBcodeDefinitions/Lists.php +++ b/libraries/BBcodeDefinitions/Lists.php @@ -7,7 +7,6 @@ namespace Sakura\BBcodeDefinitions; -use JBBCode\Parser; use JBBCode\CodeDefinition; use JBBCode\ElementNode; diff --git a/libraries/BBcodeDefinitions/Size.php b/libraries/BBcodeDefinitions/Size.php index 0960f46..6972f3f 100644 --- a/libraries/BBcodeDefinitions/Size.php +++ b/libraries/BBcodeDefinitions/Size.php @@ -7,7 +7,6 @@ namespace Sakura\BBcodeDefinitions; -use JBBCode\Parser; use JBBCode\CodeDefinition; use JBBCode\ElementNode; diff --git a/libraries/BBcodeDefinitions/User.php b/libraries/BBcodeDefinitions/User.php index 4e38aa7..40672a5 100644 --- a/libraries/BBcodeDefinitions/User.php +++ b/libraries/BBcodeDefinitions/User.php @@ -7,7 +7,6 @@ namespace Sakura\BBcodeDefinitions; -use JBBCode\Parser; use JBBCode\CodeDefinition; use JBBCode\ElementNode; diff --git a/libraries/BBcodeDefinitions/YouTube.php b/libraries/BBcodeDefinitions/YouTube.php index 2975e48..1c078ef 100644 --- a/libraries/BBcodeDefinitions/YouTube.php +++ b/libraries/BBcodeDefinitions/YouTube.php @@ -7,7 +7,6 @@ namespace Sakura\BBcodeDefinitions; -use JBBCode\Parser; use JBBCode\CodeDefinition; use JBBCode\ElementNode; diff --git a/libraries/Controllers/ForumController.php b/libraries/Controllers/ForumController.php index e16fdee..c10890f 100644 --- a/libraries/Controllers/ForumController.php +++ b/libraries/Controllers/ForumController.php @@ -7,15 +7,12 @@ namespace Sakura\Controllers; -use Sakura\Config; use Sakura\DB; -use Sakura\DBv2; use Sakura\Forum; use Sakura\Perms\Forum as ForumPerms; use Sakura\Template; use Sakura\User; use Sakura\Users; -use Sakura\Utils; /** * Forum page controllers. @@ -122,8 +119,6 @@ class ForumController extends Controller return Template::render('global/information'); } - $renderData['forum'] = $forum; - // Set parse variables Template::vars([ 'forum' => $forum, diff --git a/libraries/Controllers/MetaController.php b/libraries/Controllers/MetaController.php index 02e1a65..6b27c5e 100644 --- a/libraries/Controllers/MetaController.php +++ b/libraries/Controllers/MetaController.php @@ -9,12 +9,10 @@ namespace Sakura\Controllers; use Sakura\Config; use Sakura\DB; -use Sakura\DBv2; use Sakura\News; use Sakura\Template; use Sakura\User; use Sakura\Users; -use Sakura\Utils; /** * Meta page controllers (sections that aren't big enough to warrant a dedicated controller). diff --git a/libraries/Controllers/PremiumController.php b/libraries/Controllers/PremiumController.php index 6a1a87b..4d7fcbb 100644 --- a/libraries/Controllers/PremiumController.php +++ b/libraries/Controllers/PremiumController.php @@ -7,8 +7,8 @@ namespace Sakura\Controllers; +use Exception; use Sakura\Config; -use Sakura\News; use Sakura\Template; use Sakura\User; use Sakura\Users; diff --git a/libraries/Controllers/UserController.php b/libraries/Controllers/UserController.php index f6b529f..a79461a 100644 --- a/libraries/Controllers/UserController.php +++ b/libraries/Controllers/UserController.php @@ -9,10 +9,9 @@ namespace Sakura\Controllers; use Sakura\Config; use Sakura\DB; -use Sakura\DBv2; use Sakura\Rank; use Sakura\Template; -use Sakura\User as UserContext; +use Sakura\User; use Sakura\Utils; /** @@ -35,7 +34,7 @@ class UserController extends Controller global $currentUser; // Get the user's context - $profile = UserContext::construct($id); + $profile = User::construct($id); // If the user id is zero check if there was a namechange if ($profile->id == 0) { diff --git a/libraries/Forum/Forum.php b/libraries/Forum/Forum.php index e9fd634..7072013 100644 --- a/libraries/Forum/Forum.php +++ b/libraries/Forum/Forum.php @@ -8,9 +8,6 @@ namespace Sakura\Forum; use Sakura\DB; -use Sakura\DBv2; -use Sakura\Users; -use Sakura\User; use Sakura\Perms; /** diff --git a/libraries/Forum/Post.php b/libraries/Forum/Post.php index 1247721..7d864f6 100644 --- a/libraries/Forum/Post.php +++ b/libraries/Forum/Post.php @@ -7,9 +7,7 @@ namespace Sakura\Forum; -use Sakura\Utils; use Sakura\DB; -use Sakura\DBv2; use Sakura\User; use Sakura\BBcode; use Sakura\Config; diff --git a/libraries/Forum/Thread.php b/libraries/Forum/Thread.php index ecaa1a3..5274909 100644 --- a/libraries/Forum/Thread.php +++ b/libraries/Forum/Thread.php @@ -8,8 +8,6 @@ namespace Sakura\Forum; use Sakura\DB; -use Sakura\DBv2; -use Sakura\Utils; /** * Used to serve, create and update threads. diff --git a/libraries/Urls.php b/libraries/Urls.php index bead7c9..c60a741 100644 --- a/libraries/Urls.php +++ b/libraries/Urls.php @@ -310,7 +310,7 @@ class Urls } // Check if mod_rewrite is enabled - $rewrite = 0; //($rewrite === null ? Config::get('url_rewrite') : $rewrite) ? 1 : 0; + $rewrite = 0; // Pretty much disabled forever because of the router -- ($rewrite === null ? Config::get('url_rewrite') : $rewrite) ? 1 : 0; // Format urls $formatted = vsprintf($this->urls[$lid][$rewrite], $args); diff --git a/libraries/User.php b/libraries/User.php index c917c89..27f6151 100644 --- a/libraries/User.php +++ b/libraries/User.php @@ -873,7 +873,7 @@ class User } // Check if we have additional options as well - if ($field['field_additional'] != null) { + if (!$field['field_additional']) { // Decode the json of the additional stuff $additional = json_decode($field['field_additional'], true); diff --git a/libraries/Utils.php b/libraries/Utils.php index 3d83420..0737d21 100644 --- a/libraries/Utils.php +++ b/libraries/Utils.php @@ -27,7 +27,7 @@ class Utils public static function verifyCaptcha($response) { // Attempt to get the response - $resp = @file_get_contents( + $resp = file_get_contents( 'https://www.google.com/recaptcha/api/siteverify?secret=' . Config::get('recaptcha_private') . '&response=' @@ -36,7 +36,7 @@ class Utils // In the highly unlikely case that it failed to get anything forge a false if (!$resp) { - return false; + return []; } // Decode the response JSON from the servers diff --git a/public/settings.php b/public/settings.php index 695220f..87211aa 100644 --- a/public/settings.php +++ b/public/settings.php @@ -539,7 +539,7 @@ if (isset($_REQUEST['request-notifications']) && $_REQUEST['request-notification $metadata = getimagesize($_FILES[$mode]['tmp_name']); // Check if the image is actually an image - if ($metadata == false) { + if (!$metadata) { // Set render data $renderData['page'] = [ 'redirect' => $redirect, diff --git a/templates/misaki/settings/general.home.twig b/templates/misaki/settings/general.home.twig index 7d28001..b48ca80 100644 --- a/templates/misaki/settings/general.home.twig +++ b/templates/misaki/settings/general.home.twig @@ -1,4 +1,4 @@