diff --git a/index.php b/index.php
index 8084fc83..1c47f2e8 100644
--- a/index.php
+++ b/index.php
@@ -38,7 +38,7 @@ else
$uri = str_replace(array('index.php/', '?'), '', $uri);
define('URI', $uri);
-if(preg_match("/^[A-Za-z0-9-_%\'+]+\.png$/i", $uri)) {
+if(preg_match("/^[A-Za-z0-9-_%'+]+\.png$/i", $uri)) {
$tmp = explode('.', $uri);
$_REQUEST['name'] = urldecode($tmp[0]);
@@ -48,7 +48,7 @@ if(preg_match("/^[A-Za-z0-9-_%\'+]+\.png$/i", $uri)) {
}
if(preg_match("/^(.*)\.(gif|jpg|png|jpeg|tiff|bmp|css|js|less|map|html|php|zip|rar|gz|ttf|woff|ico)$/i", $_SERVER['REQUEST_URI'])) {
- header('HTTP/1.0 404 Not Found');
+ http_response_code(404);
exit;
}
diff --git a/release.sh b/release.sh
index 6578481b..6bf99385 100644
--- a/release.sh
+++ b/release.sh
@@ -17,12 +17,14 @@ if [ $1 = "prepare" ]; then
echo "Preparing to release version $version of the MyAAC Project!"
+ # make required directories
+ mkdir -p releases
+ mkdir -p tmp
+
# get myaac from git archive
git archive --format zip --output tmp/myaac.zip master
- # make required directories
- mkdir -p releases
- mkdir -p tmp && cd tmp
+ cd tmp/
dir="myaac-$version"
if [ -d "$dir" ] ; then
diff --git a/system/libs/DataLoader.php b/system/libs/DataLoader.php
index 4ca934e4..66b4ed27 100644
--- a/system/libs/DataLoader.php
+++ b/system/libs/DataLoader.php
@@ -63,7 +63,7 @@ class DataLoader
self::$startTime = microtime(true);
- require LIBS . 'npc.php';
+ require_once LIBS . 'npc.php';
if(NPCs::loadFromXML()) {
success(self::$locale['step_database_loaded_npcs'] . self::getLoadedTime());
}
diff --git a/system/libs/plugins.php b/system/libs/plugins.php
index 939cff4b..57507aae 100644
--- a/system/libs/plugins.php
+++ b/system/libs/plugins.php
@@ -66,7 +66,7 @@ class Plugins {
continue;
}
- if(isset($plugin['enabled']) && $plugin['enabled'] === 0) {
+ if(isset($plugin['enabled']) && !getBoolean($plugin['enabled'])) {
self::$warnings[] = 'Skipping ' . $filename . '... The plugin is disabled.';
continue;
}
diff --git a/system/libs/validator.php b/system/libs/validator.php
index 450c2573..c69f0039 100644
--- a/system/libs/validator.php
+++ b/system/libs/validator.php
@@ -223,7 +223,7 @@ class Validator
$npcCheck = config('character_name_npc_check');
if ($npcCheck) {
- require LIBS . 'npc.php';
+ require_once LIBS . 'npc.php';
NPCS::load();
if(NPCS::$npcs && in_array(strtolower($name), NPCS::$npcs)) {
self::$lastError = "Invalid name format. Do not use NPC Names";
@@ -346,7 +346,7 @@ class Validator
$npcCheck = config('character_name_npc_check');
if ($npcCheck) {
- require LIBS . 'npc.php';
+ require_once LIBS . 'npc.php';
NPCS::load();
if(NPCS::$npcs && in_array($name_lower, NPCS::$npcs)) {
self::$lastError = "Invalid name format. Do not use NPC Names";
diff --git a/system/pages/account/create_character.php b/system/pages/account/create_character.php
index c25b8ea6..7c148966 100644
--- a/system/pages/account/create_character.php
+++ b/system/pages/account/create_character.php
@@ -10,7 +10,7 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
-$character_name = isset($_POST['name']) ? stripslashes(ucwords(strtolower($_POST['name']))) : null;
+$character_name = isset($_POST['name']) ? stripslashes($_POST['name']) : null;
$character_sex = isset($_POST['sex']) ? (int)$_POST['sex'] : null;
$character_vocation = isset($_POST['vocation']) ? (int)$_POST['vocation'] : null;
$character_town = isset($_POST['town']) ? (int)$_POST['town'] : null;
@@ -42,4 +42,4 @@ if(!$character_created) {
'save' => $save,
'errors' => $errors
));
-}
\ No newline at end of file
+}
diff --git a/system/pages/creatures.php b/system/pages/creatures.php
index 3c69c4ad..c019fbe2 100644
--- a/system/pages/creatures.php
+++ b/system/pages/creatures.php
@@ -54,16 +54,14 @@ if (empty($_REQUEST['creature'])) {
$loot = json_decode($creature['loot'], true);
usort($loot, 'sort_by_chance');
- $loot_list = [];
- foreach ($loot as $item) {
+ foreach ($loot as &$item) {
$item['name'] = getItemNameById($item['id']);
$item['rarity_chance'] = round($item['chance'] / 1000, 2);
$item['rarity'] = getItemRarity($item['chance']);
$item['tooltip'] = ucfirst($item['name']) . ' Chance: ' . $item['rarity'] . (config('creatures_loot_percentage') ? ' ('. $item['rarity_chance'] .'%)' : '') . ' Max count: ' . $item['count'];
- $loot_list[] = $item;
}
- $creature['loot'] = isset($loot_list) ? $loot_list : null;
+ $creature['loot'] = isset($loot) ? $loot : null;
$creature['voices'] = isset($voices) ? $voices : null;
$creature['summons'] = isset($summons) ? $summons : null;
$creature['elements'] = isset($elements) ? $elements : null;
diff --git a/system/pages/forum/show_board.php b/system/pages/forum/show_board.php
index 2ead991d..2828f8f0 100644
--- a/system/pages/forum/show_board.php
+++ b/system/pages/forum/show_board.php
@@ -43,7 +43,15 @@ echo ' Page: '.$links_to_pages.' ';
$last_threads = $db->query("SELECT `players`.`id` as `player_id`, `players`.`name`, `" . FORUM_TABLE_PREFIX . "forum`.`post_text`, `" . FORUM_TABLE_PREFIX . "forum`.`post_topic`, `" . FORUM_TABLE_PREFIX . "forum`.`id`, `" . FORUM_TABLE_PREFIX . "forum`.`last_post`, `" . FORUM_TABLE_PREFIX . "forum`.`replies`, `" . FORUM_TABLE_PREFIX . "forum`.`views`, `" . FORUM_TABLE_PREFIX . "forum`.`post_date` FROM `players`, `" . FORUM_TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . FORUM_TABLE_PREFIX . "forum`.`author_guid` AND `" . FORUM_TABLE_PREFIX . "forum`.`section` = ".(int) $section_id." AND `" . FORUM_TABLE_PREFIX . "forum`.`first_post` = `" . FORUM_TABLE_PREFIX . "forum`.`id` ORDER BY `" . FORUM_TABLE_PREFIX . "forum`.`last_post` DESC LIMIT ".$config['forum_threads_per_page']." OFFSET ".($_page * $config['forum_threads_per_page']))->fetchAll();
if(isset($last_threads[0]))
{
- echo '
Thread Thread Starter Replies Views Last Post ';
+ echo '
+
+
+Thread
+Thread Starter
+Replies
+Views
+Last Post
+ ';
$player = new OTS_Player();
foreach($last_threads as $thread)
@@ -83,4 +91,4 @@ if(isset($last_threads[0]))
else
echo 'No threads in this board. ';
-?>
\ No newline at end of file
+?>
diff --git a/system/pages/news.php b/system/pages/news.php
index e48e1382..30e00b54 100644
--- a/system/pages/news.php
+++ b/system/pages/news.php
@@ -29,11 +29,13 @@ if(isset($_GET['archive']))
// display big news by id
if(isset($_GET['id']))
{
+ $id = (int)$_GET['id'];
+
$field_name = 'date';
- if($_REQUEST['id'] < 100000)
+ if($id < 100000)
$field_name = 'id';
- $news = $db->query('SELECT * FROM `'.TABLE_PREFIX . 'news` WHERE `hidden` != 1 AND `' . $field_name . '` = ' . (int)$_REQUEST['id'] . '');
+ $news = $db->query('SELECT * FROM `'.TABLE_PREFIX . 'news` WHERE `hidden` != 1 AND `' . $field_name . '` = ' . $id . '');
if($news->rowCount() == 1)
{
$news = $news->fetch();
@@ -227,4 +229,4 @@ if(!$news_cached)
echo $tmp_content;
}
else
- echo $news_cached;
\ No newline at end of file
+ echo $news_cached;
diff --git a/system/pages/team.php b/system/pages/team.php
index d3c92f22..2e410e12 100644
--- a/system/pages/team.php
+++ b/system/pages/team.php
@@ -9,7 +9,7 @@
* @link https://my-aac.org
*/
defined('MYAAC') or die('Direct access not allowed!');
-$title = 'Gamemasters List';
+$title = 'Support in game';
if($config['account_country'])
require SYSTEM . 'countries.conf.php';
diff --git a/system/template.php b/system/template.php
index 2b38045a..72ae3792 100644
--- a/system/template.php
+++ b/system/template.php
@@ -80,6 +80,7 @@ else {
}
$template_ini = parse_ini_file($file);
+ unset($file);
if ($cache->enabled()) {
$cache->set('template_ini_' . $template_name, serialize($template_ini));
diff --git a/system/templates/forum.boards.html.twig b/system/templates/forum.boards.html.twig
index 51198f6b..ffaadc51 100644
--- a/system/templates/forum.boards.html.twig
+++ b/system/templates/forum.boards.html.twig
@@ -1,21 +1,21 @@
Boards
-
+
- Board
+ Board
- Posts
+ Posts
- Threads
+ Threads
- Last Post
+ Last Post
{% if canEdit %}
- Options
+ Options
{% endif %}
diff --git a/system/templates/forum.show_thread.html.twig b/system/templates/forum.show_thread.html.twig
index ade8070a..f96d669f 100644
--- a/system/templates/forum.show_thread.html.twig
+++ b/system/templates/forum.show_thread.html.twig
@@ -12,8 +12,8 @@ Page: {{ links_to_pages|raw }}
-
- Author
+
+ Author
diff --git a/system/templates/guilds.change_logo.html.twig b/system/templates/guilds.change_logo.html.twig
index 6336480f..9205b7a0 100644
--- a/system/templates/guilds.change_logo.html.twig
+++ b/system/templates/guilds.change_logo.html.twig
@@ -8,15 +8,11 @@ Here you can change logo of your guild. Actuall logo:
-{% endspaceless %}
\ No newline at end of file
+
diff --git a/system/templates/guilds.change_motd.html.twig b/system/templates/guilds.change_motd.html.twig
index cbc267a9..89d7829f 100644
--- a/system/templates/guilds.change_motd.html.twig
+++ b/system/templates/guilds.change_motd.html.twig
@@ -5,12 +5,8 @@ Here you can change MOTD (Message of the Day, showed in game!) of your guild. {{ guild.getCustomField('motd')|raw }}
(max. {{ config.guild_motd_chars_limit }} chars)
-{% spaceless %}
-{% endspaceless %}
\ No newline at end of file
diff --git a/system/templates/spells.html.twig b/system/templates/spells.html.twig
index 33aa3432..cfcb4864 100644
--- a/system/templates/spells.html.twig
+++ b/system/templates/spells.html.twig
@@ -28,7 +28,6 @@
cursor: pointer;
font-weight: 600;
background-color: {{ config.vdarkborder }};
- color: #fff;
}
@@ -61,13 +60,13 @@