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 GitHub
parent 996ae625c9
commit 8d10082179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
98 changed files with 14 additions and 157 deletions

View File

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

View File

@ -68,4 +68,4 @@ ob_end_clean();
// template
$template_path = 'template/';
require ADMIN . $template_path . 'template.php';
?>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -37,4 +37,3 @@ switch($page)
default:
break;
}
?>

View File

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

View File

@ -111,7 +111,7 @@ if(!isset($foundValue)) {
$config['data_path'] = $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) {
$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';
readfile($file_name);
}
?>

View File

@ -41,4 +41,3 @@ class Data
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

@ -1126,5 +1126,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);
}
}
?>

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

@ -248,5 +248,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);
}
}
?>

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);
}
}
?>

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;
}
}
?>

View File

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

View File

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

View File

@ -11,5 +11,4 @@ $locale['encoding'] = 'utf-8';
$locale['direction']= 'ltr';
$locale['error404'] = 'Diese Seite konnte nicht gefunden werden.';
$locale['news'] = 'Neuesten Nachrichten';
?>
$locale['news'] = 'Neuesten Nachrichten';

View File

@ -123,4 +123,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/>
<span style="color: red">Please delete install/ directory.</span><br/><br/>
Post bugs and suggestions at $LINK$, thanks!';
?>

View File

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

View File

@ -11,5 +11,4 @@ $locale['encoding'] = 'utf-8';
$locale['direction']= 'ltr';
$locale['error404'] = 'Strona nie została odnaleziona.';
$locale['news'] = 'Ostatnie newsy';
?>
$locale['news'] = 'Ostatnie newsy';

View File

@ -121,4 +121,3 @@ $locale['step_finish'] = 'Finalizar';
$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/>
<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>
*/
$locale['title'] = 'MyAAC Admin';
?>

View File

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

View File

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

View File

@ -1,4 +1,3 @@
<?php
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')) {
$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);
");
}
?>

View File

@ -1,3 +1,2 @@
<?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 . "news` MODIFY `title` VARCHAR(100) 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);
return true;
}
?>

View File

@ -1,4 +1,3 @@
<?php
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
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

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

View File

@ -1,7 +1,7 @@
<?php
/**
* Account confirm mail
* Keept for compability
* Keept for compatibility
*
* @package MyAAC
* @author Slawkens <slawkens@gmail.com>
@ -13,4 +13,3 @@ defined('MYAAC') or die('Direct access not allowed!');
if($action == 'confirm_email') {
require_once PAGES . 'account/confirm_email.php';
}
?>

View File

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

View File

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

View File

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

View File

@ -80,4 +80,3 @@ if($show_form) {
}
$twig->display('account.delete_character.html.twig');
}
?>

View File

@ -202,4 +202,3 @@ function getPlayerNameByAccount($id)
return '';
}
?>

View File

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

View File

@ -66,4 +66,3 @@ echo '<div style="text-align:center"><h3>Experience stages</h3></div>
</tbody></table>
</td></tr>
</tbody></table>';
?>

View File

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

View File

@ -112,5 +112,3 @@ if(Forum::canPost($account_logged))
}
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.";
?>

View File

@ -101,5 +101,3 @@ if(Forum::canPost($account_logged))
}
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.';
?>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -115,5 +115,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>';
}
?>

View File

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

View File

@ -10,4 +10,3 @@
*/
$_GET['archive'] = true;
require 'news.php';
?>

View File

@ -369,4 +369,3 @@ function getColorByPercent($percent)
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>';
}
?>

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,
'ipBanishmentLength' => isset($config['lua']['ip_banishment_length']) ? eval('return (' . $config['lua']['ip_banishment_length'] . ') / (24 * 60 * 60);') : null,
));
?>

View File

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

View File

@ -40,4 +40,3 @@ if(!@file_exists($page_file))
// output image
//header('Content-type: image/gif');
//readfile($file);
?>

View File

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

View File

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

View File

@ -12,7 +12,7 @@
$vocation = 'Unknown vocation';
if(isset($config['vocations'][$player->getVocation()]))
$vocation = $config['vocations'][$player->getVocation()];
imagettftext($image , $fontsize, 0, 20, 52, $color, $font, 'Level:');
imagettftext($image , $fontsize, 0, 70, 52, $color, $font, $player->getLevel() . ' ' . $vocation);
@ -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.'));
imagepng($image, SIGNATURES_CACHE . $player->getID() . '.png');
imagedestroy($image);
?>

View File

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