WIP - Removing unneccessary closing tags to prevent potential issues. (#223)

* Part 1

Removing closing tags when no HTML or other output comes after the last PHP codeblock.

* Further removals

* nothing

---------

Co-authored-by: slawkens <slawkens@gmail.com>
This commit is contained in:
SRNT-GG 2023-06-15 20:53:55 +02:00 committed by slawkens
parent 171c114b0f
commit 76bfab1303
89 changed files with 11 additions and 144 deletions

View File

@ -1 +1,2 @@
<?php // nothing yet here ?> <?php
// nothing yet here

View File

@ -258,5 +258,3 @@ class Pages
return !count($errors); return !count($errors);
} }
} }
?>

View File

@ -36,4 +36,3 @@ $twig->display('admin.statistics.html.twig', array(
'account_type' => (USE_ACCOUNT_NAME ? 'name' : 'number'), 'account_type' => (USE_ACCOUNT_NAME ? 'name' : 'number'),
'points' => $points 'points' => $points
)); ));
?>

View File

@ -47,4 +47,3 @@ function version_revert($version)
$release = $version; $release = $version;
return $major . '.' . $minor . '.' . $release; return $major . '.' . $minor . '.' . $release;
}*/ }*/
?>

View File

@ -13,4 +13,3 @@ if(!function_exists('phpinfo'))
die('phpinfo() disabled on this web server.'); die('phpinfo() disabled on this web server.');
phpinfo(); phpinfo();
?>

View File

@ -38,4 +38,3 @@ if(!isset($error) || !$error) {
$error = true; $error = true;
} }
} }
?>

View File

@ -5,4 +5,3 @@ $twig->display('install.license.html.twig', array(
'license' => file_get_contents(BASE . 'LICENSE'), 'license' => file_get_contents(BASE . 'LICENSE'),
'buttons' => next_buttons() 'buttons' => next_buttons()
)); ));
?>

View File

@ -18,4 +18,3 @@ $twig->display('install.config.html.twig', array(
'errors' => isset($errors) ? $errors : null, 'errors' => isset($errors) ? $errors : null,
'buttons' => next_buttons() 'buttons' => next_buttons()
)); ));
?>

View File

@ -51,4 +51,3 @@ else
updateDatabaseConfig('views_counter', $views_counter); // update counter updateDatabaseConfig('views_counter', $views_counter); // update counter
} }
} }
?>

View File

@ -122,7 +122,7 @@ if(!isset($foundValue)) {
$config['data_path'] = $foundValue; $config['data_path'] = $foundValue;
unset($foundValue); unset($foundValue);
// new config values for compability // new config values for compatibility
if(!isset($config['highscores_ids_hidden']) || count($config['highscores_ids_hidden']) == 0) { if(!isset($config['highscores_ids_hidden']) || count($config['highscores_ids_hidden']) == 0) {
$config['highscores_ids_hidden'] = array(0); $config['highscores_ids_hidden'] = array(0);
} }

View File

@ -58,4 +58,3 @@ function outputItem($id = 100, $count = 1)
$file_name = Items_Images::$outputDir . $file_name . '.gif'; $file_name = Items_Images::$outputDir . $file_name . '.gif';
readfile($file_name); readfile($file_name);
} }
?>

View File

@ -41,4 +41,3 @@ class Data
return $db->update($this->table, $data, $where); return $db->update($this->table, $data, $where);
} }
} }
?>

View File

@ -32,5 +32,3 @@ class E_OTS_ErrorCode extends Exception
} }
/**#@-*/ /**#@-*/
?>

View File

@ -36,5 +36,3 @@ class E_OTS_Generic extends E_OTS_ErrorCode
} }
/**#@-*/ /**#@-*/
?>

View File

@ -22,5 +22,3 @@ class E_OTS_NotAContainer extends Exception
} }
/**#@-*/ /**#@-*/
?>

View File

@ -32,5 +32,3 @@ class E_OTS_OTBMError extends E_OTS_ErrorCode
} }
/**#@-*/ /**#@-*/
?>

View File

@ -22,5 +22,3 @@ class E_OTS_ReadOnly extends Exception
} }
/**#@-*/ /**#@-*/
?>

View File

@ -37,5 +37,3 @@ interface IOTS_Cipher
} }
/**#@-*/ /**#@-*/
?>

View File

@ -89,5 +89,3 @@ interface IOTS_DataDisplay
} }
/**#@-*/ /**#@-*/
?>

View File

@ -96,5 +96,3 @@ interface IOTS_Display
} }
/**#@-*/ /**#@-*/
?>

View File

@ -67,5 +67,3 @@ interface IOTS_GuildAction
} }
/**#@-*/ /**#@-*/
?>

View File

@ -1198,5 +1198,3 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
} }
/**#@-*/ /**#@-*/
?>

View File

@ -34,5 +34,3 @@ class OTS_AccountBans_List extends OTS_Bans_List
$this->setFilter($filter); $this->setFilter($filter);
} }
} }
?>

View File

@ -735,5 +735,3 @@ class OTS_Admin
} }
/**#@-*/ /**#@-*/
?>

View File

@ -100,5 +100,3 @@ class OTS_Bans_List extends OTS_Base_List
} }
} }
} }
?>

View File

@ -265,5 +265,3 @@ abstract class OTS_Base_DB extends PDO implements IOTS_DB
} }
/**#@-*/ /**#@-*/
?>

View File

@ -146,5 +146,3 @@ class OTS_BinaryTools
} }
/**#@-*/ /**#@-*/
?>

View File

@ -149,5 +149,3 @@ class OTS_Container extends OTS_Item implements IteratorAggregate
} }
/**#@-*/ /**#@-*/
?>

View File

@ -357,5 +357,3 @@ class OTS_FileLoader
} }
/**#@-*/ /**#@-*/
?>

View File

@ -671,5 +671,3 @@ class OTS_Group extends OTS_Row_DAO implements IteratorAggregate, Countable
} }
/**#@-*/ /**#@-*/
?>

View File

@ -837,5 +837,3 @@ class OTS_Guild extends OTS_Row_DAO implements IteratorAggregate, Countable
} }
/**#@-*/ /**#@-*/
?>

View File

@ -72,5 +72,3 @@ class OTS_GuildRanks_List extends OTS_Base_List
} }
/**#@-*/ /**#@-*/
?>

View File

@ -529,5 +529,3 @@ class OTS_House extends OTS_Row_DAO
} }
/**#@-*/ /**#@-*/
?>

View File

@ -34,5 +34,3 @@ class OTS_IPBans_List extends OTS_Bans_List
$this->setFilter($filter); $this->setFilter($filter);
} }
} }
?>

View File

@ -387,5 +387,3 @@ class OTS_InfoRespond extends DOMDocument
} }
/**#@-*/ /**#@-*/
?>

View File

@ -676,5 +676,3 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
} }
/**#@-*/ /**#@-*/
?>

View File

@ -130,5 +130,3 @@ class OTS_MapCoords
} }
/**#@-*/ /**#@-*/
?>

View File

@ -299,5 +299,3 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
} }
/**#@-*/ /**#@-*/
?>

View File

@ -3627,5 +3627,3 @@ class OTS_Player extends OTS_Row_DAO
} }
/**#@-*/ /**#@-*/
?>

View File

@ -34,5 +34,3 @@ class OTS_PlayerBans_List extends OTS_Bans_List
$this->setFilter($filter); $this->setFilter($filter);
} }
} }
?>

View File

@ -75,5 +75,3 @@ abstract class OTS_Row_DAO extends OTS_Base_DAO
} }
/**#@-*/ /**#@-*/
?>

View File

@ -121,5 +121,3 @@ class OTS_SQLField
} }
/**#@-*/ /**#@-*/
?>

View File

@ -227,5 +227,3 @@ class OTS_ServerInfo
} }
/**#@-*/ /**#@-*/
?>

View File

@ -482,5 +482,3 @@ class OTS_Spell
} }
/**#@-*/ /**#@-*/
?>

View File

@ -113,5 +113,3 @@ class OTS_Toolbox
} }
/**#@-*/ /**#@-*/
?>

View File

@ -151,5 +151,3 @@ class OTS_XTEA implements IOTS_Cipher
} }
/**#@-*/ /**#@-*/
?>

View File

@ -282,4 +282,3 @@ class TokenAuth6238 {
return $result; return $result;
} }
} }
?>

View File

@ -451,4 +451,3 @@ class Validator
return self::$lastError; return self::$lastError;
} }
} }
?>

View File

@ -6,4 +6,3 @@
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
*/ */
$locale['title'] = 'MyAAC Admin'; $locale['title'] = 'MyAAC Admin';
?>

View File

@ -12,4 +12,3 @@ $locale['direction']= 'ltr';
$locale['error404'] = 'Diese Seite konnte nicht gefunden werden.'; $locale['error404'] = 'Diese Seite konnte nicht gefunden werden.';
$locale['news'] = 'Neuesten Nachrichten'; $locale['news'] = 'Neuesten Nachrichten';
?>

View File

@ -131,4 +131,3 @@ $locale['step_finish_title'] = 'Installation finished!';
$locale['step_finish_desc'] = 'Congratulations! <b>MyAAC</b> is ready to use!<br/>You can now login to $ADMIN_PANEL$, or visit $HOMEPAGE$.<br/><br/> $locale['step_finish_desc'] = 'Congratulations! <b>MyAAC</b> is ready to use!<br/>You can now login to $ADMIN_PANEL$, or visit $HOMEPAGE$.<br/><br/>
<span style="color: red">Please delete install/ directory.</span><br/><br/> <span style="color: red">Please delete install/ directory.</span><br/><br/>
Post bugs and suggestions at $LINK$, thanks!'; Post bugs and suggestions at $LINK$, thanks!';
?>

View File

@ -6,4 +6,3 @@
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
*/ */
$locale['title'] = 'MyAAC Admin'; $locale['title'] = 'MyAAC Admin';
?>

View File

@ -118,4 +118,3 @@ $locale['step_finish'] = 'Finalizar';
$locale['step_finish_title'] = 'Instalação terminada!'; $locale['step_finish_title'] = 'Instalação terminada!';
$locale['step_finish_desc'] = 'Parabéns! <b>MyAAC</b> está pronto para uso!<br/>Agora você pode fazer login em $ADMIN_PANEL$ ou visitar $HOMEPAGE$.<br/><br/> $locale['step_finish_desc'] = 'Parabéns! <b>MyAAC</b> está pronto para uso!<br/>Agora você pode fazer login em $ADMIN_PANEL$ ou visitar $HOMEPAGE$.<br/><br/>
<span style = "color: red">Por favor remova a pasta install/.</span><br/><br/>Postar bugs e sugestões em $LINK$, obrigado!'; <span style = "color: red">Por favor remova a pasta install/.</span><br/><br/>Postar bugs e sugestões em $LINK$, obrigado!';
?>

View File

@ -6,4 +6,3 @@
* @author Sizaro <sizaro@live.se> * @author Sizaro <sizaro@live.se>
*/ */
$locale['title'] = 'MyAAC Admin'; $locale['title'] = 'MyAAC Admin';
?>

View File

@ -12,4 +12,3 @@ $locale['direction']= 'ltr';
$locale['error404'] = 'Sidan kunde inte hittas.'; $locale['error404'] = 'Sidan kunde inte hittas.';
$locale['news'] = 'Senaste nyheterna'; $locale['news'] = 'Senaste nyheterna';
?>

View File

@ -17,4 +17,3 @@
'thumb' => str_replace('/screenshots/', '/gallery/', $item['thumb']), 'thumb' => str_replace('/screenshots/', '/gallery/', $item['thumb']),
), array('id' => $item['id'])); ), array('id' => $item['id']));
} }
?>

View File

@ -1,4 +1,3 @@
<?php <?php
if($db->hasColumn(TABLE_PREFIX . 'spells', 'spell')) if($db->hasColumn(TABLE_PREFIX . 'spells', 'spell'))
$db->query("ALTER TABLE `" . TABLE_PREFIX . "spells` DROP COLUMN `spell`;"); $db->query("ALTER TABLE `" . TABLE_PREFIX . "spells` DROP COLUMN `spell`;");
?>

View File

@ -8,4 +8,3 @@ if(!$db->hasColumn(TABLE_PREFIX . 'forum_boards', 'guild')) {
if(!$db->hasColumn(TABLE_PREFIX . 'forum_boards', 'access')) { if(!$db->hasColumn(TABLE_PREFIX . 'forum_boards', 'access')) {
$db->query("ALTER TABLE `" . TABLE_PREFIX . "forum_boards` ADD `access` TINYINT(1) NOT NULL DEFAULT 0 AFTER `guild`;"); $db->query("ALTER TABLE `" . TABLE_PREFIX . "forum_boards` ADD `access` TINYINT(1) NOT NULL DEFAULT 0 AFTER `guild`;");
} }
?>

View File

@ -86,4 +86,3 @@ INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VA
INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Shop History', 'gifts/history', 6, 2); INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Shop History', 'gifts/history', 6, 2);
"); ");
} }
?>

View File

@ -1,3 +1,2 @@
<?php <?php
// this migration has been removed, but file kept for compability // this migration has been removed, but file kept for compatibility
?>

View File

@ -3,4 +3,3 @@
$db->query("ALTER TABLE `" . TABLE_PREFIX . "movies` MODIFY `title` VARCHAR(100) NOT NULL DEFAULT '';"); $db->query("ALTER TABLE `" . TABLE_PREFIX . "movies` MODIFY `title` VARCHAR(100) NOT NULL DEFAULT '';");
$db->query("ALTER TABLE `" . TABLE_PREFIX . "news` MODIFY `title` VARCHAR(100) NOT NULL DEFAULT '';"); $db->query("ALTER TABLE `" . TABLE_PREFIX . "news` MODIFY `title` VARCHAR(100) NOT NULL DEFAULT '';");
$db->query("ALTER TABLE `" . TABLE_PREFIX . "news` MODIFY `body` TEXT NOT NULL DEFAULT '';"); $db->query("ALTER TABLE `" . TABLE_PREFIX . "news` MODIFY `body` TEXT NOT NULL DEFAULT '';");
?>

View File

@ -45,4 +45,3 @@ function databaseMigration20(&$content = '') {
file_put_contents($config_file, $content, FILE_APPEND); file_put_contents($config_file, $content, FILE_APPEND);
return true; return true;
} }
?>

View File

@ -1,4 +1,3 @@
<?php <?php
if(!$db->hasColumn(TABLE_PREFIX . 'monsters', 'id')) if(!$db->hasColumn(TABLE_PREFIX . 'monsters', 'id'))
$db->query("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `id` int(11) NOT NULL AUTO_INCREMENT primary key FIRST;"); $db->query("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `id` int(11) NOT NULL AUTO_INCREMENT primary key FIRST;");
?>

View File

@ -1,4 +1,3 @@
<?php <?php
if(!$db->hasColumn(TABLE_PREFIX . 'hooks', 'enabled')) if(!$db->hasColumn(TABLE_PREFIX . 'hooks', 'enabled'))
$db->query("ALTER TABLE `" . TABLE_PREFIX . "hooks` ADD `enabled` INT(1) NOT NULL DEFAULT 1;"); $db->query("ALTER TABLE `" . TABLE_PREFIX . "hooks` ADD `enabled` INT(1) NOT NULL DEFAULT 1;");
?>

View File

@ -15,4 +15,3 @@
foreach($boards as $id => $board) foreach($boards as $id => $board)
$db->query('UPDATE `' . TABLE_PREFIX . 'forum_boards` SET `ordering` = ' . $id . ' WHERE `name` = ' . $db->quote($board)); $db->query('UPDATE `' . TABLE_PREFIX . 'forum_boards` SET `ordering` = ' . $id . ' WHERE `name` = ' . $db->quote($board));
} }
?>

View File

@ -166,4 +166,3 @@ if(isset($_POST['emailchangecancel']) && $_POST['emailchangecancel'] == 1) {
'custom_buttons' => $custom_buttons 'custom_buttons' => $custom_buttons
)); ));
} }
?>

View File

@ -112,5 +112,3 @@ else
)); ));
} }
} }
?>

View File

@ -91,5 +91,3 @@ else
)); ));
} }
} }
?>

View File

@ -546,4 +546,3 @@ elseif($action == 'setnewpassword')
' . $twig->render('buttons.submit.html.twig') . '</div> ' . $twig->render('buttons.submit.html.twig') . '</div>
</TD></TR></FORM></TABLE></TABLE>'; </TD></TR></FORM></TABLE></TABLE>';
} }
?>

View File

@ -339,4 +339,3 @@ $showed = $post = $reply = false;
{ {
echo '<br><br><a href="?subtopic=bugtracker&control=true">[ADMIN PANEL]</a>'; echo '<br><br><a href="?subtopic=bugtracker&control=true">[ADMIN PANEL]</a>';
} }
?>

View File

@ -185,4 +185,3 @@ class FAQ
return !count($errors); return !count($errors);
} }
} }
?>

View File

@ -114,5 +114,3 @@ if(Forum::canPost($account_logged))
} }
else else
echo "<br/>Your account is banned, deleted or you don't have any player with level " . $config['forum_level_required'] . " on your account. You can't post."; echo "<br/>Your account is banned, deleted or you don't have any player with level " . $config['forum_level_required'] . " on your account. You can't post.";
?>

View File

@ -103,5 +103,3 @@ if(Forum::canPost($account_logged))
} }
else else
echo 'Your account is banned, deleted or you don\'t have any player with level '.$config['forum_level_required'].' on your account. You can\'t post.'; echo 'Your account is banned, deleted or you don\'t have any player with level '.$config['forum_level_required'].' on your account. You can\'t post.';
?>

View File

@ -312,4 +312,3 @@ class Gallery
return !count($errors); return !count($errors);
} }
} }
?>

View File

@ -72,5 +72,3 @@ if(!empty($errors)) {
'action' => '?subtopic=guilds' 'action' => '?subtopic=guilds'
)); ));
} }
?>

View File

@ -75,5 +75,3 @@ if(!empty($errors)) {
'action' => '?subtopic=guilds' 'action' => '?subtopic=guilds'
)); ));
} }
?>

View File

@ -68,4 +68,3 @@ else
echo "0 players found."; echo "0 players found.";
$twig->display('guilds.back_button.html.twig'); $twig->display('guilds.back_button.html.twig');
?>

View File

@ -66,5 +66,3 @@ if(!empty($errors)) {
'action' => '?subtopic=guilds' 'action' => '?subtopic=guilds'
)); ));
} }
?>

View File

@ -125,5 +125,3 @@ if(!empty($guild_errors)) {
'action' => '?subtopic=guilds' 'action' => '?subtopic=guilds'
)); ));
} }
?>

View File

@ -114,5 +114,3 @@ else
)); ));
} }
} }
?>

View File

@ -117,5 +117,3 @@ if(!empty($guild_errors)) {
echo '<br/><div style="text-align:center"><form action="?subtopic=guilds" method="post">' . $twig->render('buttons.back.html.twig') . '</form></div>'; echo '<br/><div style="text-align:center"><form action="?subtopic=guilds" method="post">' . $twig->render('buttons.back.html.twig') . '</form></div>';
} }
?>

View File

@ -369,4 +369,3 @@ function getColorByPercent($percent)
echo 'This poll doesn\'t exist.<br>'; echo 'This poll doesn\'t exist.<br>';
echo '<div class=\'hr1\'></div><a href="?subtopic='.$link.'"><span style="font-size: 13px"><b>Go to list of polls</b></span></a>'; echo '<div class=\'hr1\'></div><a href="?subtopic='.$link.'"><span style="font-size: 13px"><b>Go to list of polls</b></span></a>';
} }
?>

View File

@ -108,6 +108,3 @@ $twig->display('serverinfo.html.twig', array(
'finalBanishmentLength' => isset($config['lua']['final_banishment_length']) ? eval('return (' . $config['lua']['final_banishment_length'] . ') / (24 * 60 * 60);') : null, 'finalBanishmentLength' => isset($config['lua']['final_banishment_length']) ? eval('return (' . $config['lua']['final_banishment_length'] . ') / (24 * 60 * 60);') : null,
'ipBanishmentLength' => isset($config['lua']['ip_banishment_length']) ? eval('return (' . $config['lua']['ip_banishment_length'] . ') / (24 * 60 * 60);') : null, 'ipBanishmentLength' => isset($config['lua']['ip_banishment_length']) ? eval('return (' . $config['lua']['ip_banishment_length'] . ') / (24 * 60 * 60);') : null,
)); ));
?>

View File

@ -74,4 +74,3 @@ foreach($groupList as $id => $group)
$twig->display('team.html.twig', array( $twig->display('team.html.twig', array(
'groupmember' => $groupMember 'groupmember' => $groupMember
)); ));
?>

View File

@ -459,4 +459,3 @@ function logo_monster()
global $config; global $config;
return str_replace(" ", "", trim(strtolower($config['logo_monster']))); return str_replace(" ", "", trim(strtolower($config['logo_monster'])));
} }
?>

View File

@ -112,5 +112,3 @@ function error_($desc) {
)); ));
exit(); exit();
} }
?>

View File

@ -26,4 +26,3 @@
imagettftext($image , $fontsize, 0, 100, 95, $color, $font, (($player->getLastLogin() > 0) ? date("j F Y, g:i a", $player->getLastLogin()) : 'Never logged in.')); imagettftext($image , $fontsize, 0, 100, 95, $color, $font, (($player->getLastLogin() > 0) ? date("j F Y, g:i a", $player->getLastLogin()) : 'Never logged in.'));
imagepng($image, SIGNATURES_CACHE . $player->getID() . '.png'); imagepng($image, SIGNATURES_CACHE . $player->getID() . '.png');
imagedestroy($image); imagedestroy($image);
?>

View File

@ -168,4 +168,3 @@
} }
$MadGD->save($player->getID()); $MadGD->save($player->getID());
?>