a bit of cleanup
This commit is contained in:
parent
d55ae7e936
commit
03ba7e9ffe
20 changed files with 15 additions and 36 deletions
|
@ -14,7 +14,7 @@
|
||||||
"AT": "Austria",
|
"AT": "Austria",
|
||||||
"AU": "Australia",
|
"AU": "Australia",
|
||||||
"AW": "Aruba",
|
"AW": "Aruba",
|
||||||
"AX": "Åland Islands",
|
"AX": "Åland Islands",
|
||||||
"AZ": "Azerbaijan",
|
"AZ": "Azerbaijan",
|
||||||
"BA": "Bosnia and Herzegovina",
|
"BA": "Bosnia and Herzegovina",
|
||||||
"BB": "Barbados",
|
"BB": "Barbados",
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
"BH": "Bahrain",
|
"BH": "Bahrain",
|
||||||
"BI": "Burundi",
|
"BI": "Burundi",
|
||||||
"BJ": "Benin",
|
"BJ": "Benin",
|
||||||
"BL": "Saint Barthélemy",
|
"BL": "Saint Barthélemy",
|
||||||
"BM": "Bermuda",
|
"BM": "Bermuda",
|
||||||
"BN": "Brunei Darussalam",
|
"BN": "Brunei Darussalam",
|
||||||
"BO": "Plurinational State of Bolivia",
|
"BO": "Plurinational State of Bolivia",
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
"CF": "Central African Republic",
|
"CF": "Central African Republic",
|
||||||
"CG": "Congo",
|
"CG": "Congo",
|
||||||
"CH": "Switzerland",
|
"CH": "Switzerland",
|
||||||
"CI": "Côte d'Ivoire",
|
"CI": "Côte d'Ivoire",
|
||||||
"CK": "Cook Islands",
|
"CK": "Cook Islands",
|
||||||
"CL": "Chile",
|
"CL": "Chile",
|
||||||
"CM": "Cameroon",
|
"CM": "Cameroon",
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
"CR": "Costa Rica",
|
"CR": "Costa Rica",
|
||||||
"CU": "Cuba",
|
"CU": "Cuba",
|
||||||
"CV": "Cabo Verde",
|
"CV": "Cabo Verde",
|
||||||
"CW": "Curaçao",
|
"CW": "Curaçao",
|
||||||
"CX": "Christmas Island",
|
"CX": "Christmas Island",
|
||||||
"CY": "Cyprus",
|
"CY": "Cyprus",
|
||||||
"CZ": "Czech Republic",
|
"CZ": "Czech Republic",
|
||||||
|
@ -187,7 +187,7 @@
|
||||||
"PW": "Palau",
|
"PW": "Palau",
|
||||||
"PY": "Paraguay",
|
"PY": "Paraguay",
|
||||||
"QA": "Qatar",
|
"QA": "Qatar",
|
||||||
"RE": "Réunion",
|
"RE": "Réunion",
|
||||||
"RO": "Romania",
|
"RO": "Romania",
|
||||||
"RS": "Serbia",
|
"RS": "Serbia",
|
||||||
"RU": "Russian Federation",
|
"RU": "Russian Federation",
|
||||||
|
|
|
@ -126,7 +126,7 @@ class BBcode
|
||||||
public static function text($text)
|
public static function text($text)
|
||||||
{
|
{
|
||||||
// Check if $bbcode is still null
|
// Check if $bbcode is still null
|
||||||
if (self::$bbcode == null) {
|
if (!self::$bbcode) {
|
||||||
self::init();
|
self::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
namespace Sakura\BBcodeDefinitions;
|
namespace Sakura\BBcodeDefinitions;
|
||||||
|
|
||||||
use JBBCode\Parser;
|
|
||||||
use JBBCode\CodeDefinition;
|
use JBBCode\CodeDefinition;
|
||||||
use JBBCode\ElementNode;
|
use JBBCode\ElementNode;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
namespace Sakura\BBcodeDefinitions;
|
namespace Sakura\BBcodeDefinitions;
|
||||||
|
|
||||||
use JBBCode\Parser;
|
|
||||||
use JBBCode\CodeDefinition;
|
use JBBCode\CodeDefinition;
|
||||||
use JBBCode\ElementNode;
|
use JBBCode\ElementNode;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
namespace Sakura\BBcodeDefinitions;
|
namespace Sakura\BBcodeDefinitions;
|
||||||
|
|
||||||
use JBBCode\Parser;
|
|
||||||
use JBBCode\CodeDefinition;
|
use JBBCode\CodeDefinition;
|
||||||
use JBBCode\ElementNode;
|
use JBBCode\ElementNode;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
namespace Sakura\BBcodeDefinitions;
|
namespace Sakura\BBcodeDefinitions;
|
||||||
|
|
||||||
use JBBCode\Parser;
|
|
||||||
use JBBCode\CodeDefinition;
|
use JBBCode\CodeDefinition;
|
||||||
use JBBCode\ElementNode;
|
use JBBCode\ElementNode;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
namespace Sakura\BBcodeDefinitions;
|
namespace Sakura\BBcodeDefinitions;
|
||||||
|
|
||||||
use JBBCode\Parser;
|
|
||||||
use JBBCode\CodeDefinition;
|
use JBBCode\CodeDefinition;
|
||||||
use JBBCode\ElementNode;
|
use JBBCode\ElementNode;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
namespace Sakura\BBcodeDefinitions;
|
namespace Sakura\BBcodeDefinitions;
|
||||||
|
|
||||||
use JBBCode\Parser;
|
|
||||||
use JBBCode\CodeDefinition;
|
use JBBCode\CodeDefinition;
|
||||||
use JBBCode\ElementNode;
|
use JBBCode\ElementNode;
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,12 @@
|
||||||
|
|
||||||
namespace Sakura\Controllers;
|
namespace Sakura\Controllers;
|
||||||
|
|
||||||
use Sakura\Config;
|
|
||||||
use Sakura\DB;
|
use Sakura\DB;
|
||||||
use Sakura\DBv2;
|
|
||||||
use Sakura\Forum;
|
use Sakura\Forum;
|
||||||
use Sakura\Perms\Forum as ForumPerms;
|
use Sakura\Perms\Forum as ForumPerms;
|
||||||
use Sakura\Template;
|
use Sakura\Template;
|
||||||
use Sakura\User;
|
use Sakura\User;
|
||||||
use Sakura\Users;
|
use Sakura\Users;
|
||||||
use Sakura\Utils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forum page controllers.
|
* Forum page controllers.
|
||||||
|
@ -122,8 +119,6 @@ class ForumController extends Controller
|
||||||
return Template::render('global/information');
|
return Template::render('global/information');
|
||||||
}
|
}
|
||||||
|
|
||||||
$renderData['forum'] = $forum;
|
|
||||||
|
|
||||||
// Set parse variables
|
// Set parse variables
|
||||||
Template::vars([
|
Template::vars([
|
||||||
'forum' => $forum,
|
'forum' => $forum,
|
||||||
|
|
|
@ -9,12 +9,10 @@ namespace Sakura\Controllers;
|
||||||
|
|
||||||
use Sakura\Config;
|
use Sakura\Config;
|
||||||
use Sakura\DB;
|
use Sakura\DB;
|
||||||
use Sakura\DBv2;
|
|
||||||
use Sakura\News;
|
use Sakura\News;
|
||||||
use Sakura\Template;
|
use Sakura\Template;
|
||||||
use Sakura\User;
|
use Sakura\User;
|
||||||
use Sakura\Users;
|
use Sakura\Users;
|
||||||
use Sakura\Utils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Meta page controllers (sections that aren't big enough to warrant a dedicated controller).
|
* Meta page controllers (sections that aren't big enough to warrant a dedicated controller).
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
namespace Sakura\Controllers;
|
namespace Sakura\Controllers;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use Sakura\Config;
|
use Sakura\Config;
|
||||||
use Sakura\News;
|
|
||||||
use Sakura\Template;
|
use Sakura\Template;
|
||||||
use Sakura\User;
|
use Sakura\User;
|
||||||
use Sakura\Users;
|
use Sakura\Users;
|
||||||
|
|
|
@ -9,10 +9,9 @@ namespace Sakura\Controllers;
|
||||||
|
|
||||||
use Sakura\Config;
|
use Sakura\Config;
|
||||||
use Sakura\DB;
|
use Sakura\DB;
|
||||||
use Sakura\DBv2;
|
|
||||||
use Sakura\Rank;
|
use Sakura\Rank;
|
||||||
use Sakura\Template;
|
use Sakura\Template;
|
||||||
use Sakura\User as UserContext;
|
use Sakura\User;
|
||||||
use Sakura\Utils;
|
use Sakura\Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,7 +34,7 @@ class UserController extends Controller
|
||||||
global $currentUser;
|
global $currentUser;
|
||||||
|
|
||||||
// Get the user's context
|
// 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 the user id is zero check if there was a namechange
|
||||||
if ($profile->id == 0) {
|
if ($profile->id == 0) {
|
||||||
|
|
|
@ -8,9 +8,6 @@
|
||||||
namespace Sakura\Forum;
|
namespace Sakura\Forum;
|
||||||
|
|
||||||
use Sakura\DB;
|
use Sakura\DB;
|
||||||
use Sakura\DBv2;
|
|
||||||
use Sakura\Users;
|
|
||||||
use Sakura\User;
|
|
||||||
use Sakura\Perms;
|
use Sakura\Perms;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,9 +7,7 @@
|
||||||
|
|
||||||
namespace Sakura\Forum;
|
namespace Sakura\Forum;
|
||||||
|
|
||||||
use Sakura\Utils;
|
|
||||||
use Sakura\DB;
|
use Sakura\DB;
|
||||||
use Sakura\DBv2;
|
|
||||||
use Sakura\User;
|
use Sakura\User;
|
||||||
use Sakura\BBcode;
|
use Sakura\BBcode;
|
||||||
use Sakura\Config;
|
use Sakura\Config;
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
namespace Sakura\Forum;
|
namespace Sakura\Forum;
|
||||||
|
|
||||||
use Sakura\DB;
|
use Sakura\DB;
|
||||||
use Sakura\DBv2;
|
|
||||||
use Sakura\Utils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to serve, create and update threads.
|
* Used to serve, create and update threads.
|
||||||
|
|
|
@ -310,7 +310,7 @@ class Urls
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if mod_rewrite is enabled
|
// 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
|
// Format urls
|
||||||
$formatted = vsprintf($this->urls[$lid][$rewrite], $args);
|
$formatted = vsprintf($this->urls[$lid][$rewrite], $args);
|
||||||
|
|
|
@ -873,7 +873,7 @@ class User
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if we have additional options as well
|
// Check if we have additional options as well
|
||||||
if ($field['field_additional'] != null) {
|
if (!$field['field_additional']) {
|
||||||
// Decode the json of the additional stuff
|
// Decode the json of the additional stuff
|
||||||
$additional = json_decode($field['field_additional'], true);
|
$additional = json_decode($field['field_additional'], true);
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ class Utils
|
||||||
public static function verifyCaptcha($response)
|
public static function verifyCaptcha($response)
|
||||||
{
|
{
|
||||||
// Attempt to get the response
|
// Attempt to get the response
|
||||||
$resp = @file_get_contents(
|
$resp = file_get_contents(
|
||||||
'https://www.google.com/recaptcha/api/siteverify?secret='
|
'https://www.google.com/recaptcha/api/siteverify?secret='
|
||||||
. Config::get('recaptcha_private')
|
. Config::get('recaptcha_private')
|
||||||
. '&response='
|
. '&response='
|
||||||
|
@ -36,7 +36,7 @@ class Utils
|
||||||
|
|
||||||
// In the highly unlikely case that it failed to get anything forge a false
|
// In the highly unlikely case that it failed to get anything forge a false
|
||||||
if (!$resp) {
|
if (!$resp) {
|
||||||
return false;
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decode the response JSON from the servers
|
// Decode the response JSON from the servers
|
||||||
|
|
|
@ -539,7 +539,7 @@ if (isset($_REQUEST['request-notifications']) && $_REQUEST['request-notification
|
||||||
$metadata = getimagesize($_FILES[$mode]['tmp_name']);
|
$metadata = getimagesize($_FILES[$mode]['tmp_name']);
|
||||||
|
|
||||||
// Check if the image is actually an image
|
// Check if the image is actually an image
|
||||||
if ($metadata == false) {
|
if (!$metadata) {
|
||||||
// Set render data
|
// Set render data
|
||||||
$renderData['page'] = [
|
$renderData['page'] = [
|
||||||
'redirect' => $redirect,
|
'redirect' => $redirect,
|
||||||
|
|
Reference in a new issue