mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-13 12:22:03 +02:00
[ticket/9556] Drop php closing tags, add trailing newline
Closing tags converted using Oleg's script. remove-php-end-tags.py -a . Trailing newlines added using the following where $ext is file extension. find . -type f -name "*.$ext" -print | xargs printf "e %s\nw\n" | ed -s; Extensions: php, css, html, js, xml. PHPBB3-9556
This commit is contained in:
parent
2e51e68ca1
commit
af5b9a9640
@ -411,5 +411,3 @@ function run_command($command)
|
||||
$result = trim(`$command`);
|
||||
echo "\n- Command Run: " . $command . "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -207,4 +207,4 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
|
||||
$phpcsFile->addError($message, $tags['license'][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,4 +48,4 @@ class phpbb_Tests_Commenting_FileCommentUnitTest extends AbstractSniffUnitTest
|
||||
8 => 1
|
||||
);
|
||||
}//end getWarningList()
|
||||
}
|
||||
}
|
||||
|
@ -40,4 +40,4 @@ class PHP_CodeSniffer_Standards_phpbb_phpbbCodingStandard extends PHP_CodeSniffe
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -618,5 +618,3 @@ function validate_range($value_ary, &$error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -373,4 +373,4 @@
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
|
@ -121,4 +121,4 @@
|
||||
|
||||
</form>
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
|
@ -74,4 +74,4 @@
|
||||
|
||||
</form>
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
|
@ -252,4 +252,4 @@
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
|
@ -199,4 +199,4 @@
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
|
@ -354,4 +354,4 @@
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
|
@ -10,4 +10,4 @@
|
||||
{PHPINFO}
|
||||
</div>
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
|
@ -68,4 +68,4 @@ function iframe_updated()
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
|
@ -49,4 +49,4 @@
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
|
@ -75,4 +75,4 @@
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
</form>
|
||||
|
@ -73,4 +73,4 @@
|
||||
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
|
||||
</fieldset>
|
||||
{S_FORM_TOKEN}
|
||||
</form>
|
||||
</form>
|
||||
|
@ -155,4 +155,4 @@
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
</form>
|
||||
|
@ -63,4 +63,4 @@
|
||||
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
</form>
|
||||
</form>
|
||||
|
@ -114,4 +114,4 @@
|
||||
<input class="button2" type="submit" name="preview" value="{L_PREVIEW}" />
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
</form>
|
||||
</form>
|
||||
|
@ -75,4 +75,4 @@
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@ -400,4 +400,4 @@ function getCaretPosition(txtarea)
|
||||
}
|
||||
|
||||
return caretPos;
|
||||
}
|
||||
}
|
||||
|
@ -131,4 +131,4 @@
|
||||
</form>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- INCLUDE install_footer.html -->
|
||||
<!-- INCLUDE install_footer.html -->
|
||||
|
@ -5,4 +5,4 @@
|
||||
<p>{MESSAGE_TEXT}</p>
|
||||
</div>
|
||||
|
||||
<!-- INCLUDE install_footer.html -->
|
||||
<!-- INCLUDE install_footer.html -->
|
||||
|
@ -24,4 +24,4 @@
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@ -3,4 +3,4 @@
|
||||
<h1>{TITLE}</h1>
|
||||
<p>{BODY}</p>
|
||||
|
||||
<!-- INCLUDE install_footer.html -->
|
||||
<!-- INCLUDE install_footer.html -->
|
||||
|
@ -259,4 +259,4 @@ table.hrdiff caption span {
|
||||
</div>
|
||||
|
||||
|
||||
<!-- INCLUDE simple_footer.html -->
|
||||
<!-- INCLUDE simple_footer.html -->
|
||||
|
@ -5,4 +5,4 @@
|
||||
<p>{MESSAGE_TEXT}</p>
|
||||
</div>
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
|
@ -32,4 +32,4 @@
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@ -35,4 +35,4 @@
|
||||
|
||||
<p>{L_ROLE_NOT_ASSIGNED}</p>
|
||||
|
||||
<!-- END role_mask -->
|
||||
<!-- END role_mask -->
|
||||
|
@ -37,4 +37,4 @@
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
<!-- INCLUDE simple_footer.html -->
|
||||
<!-- INCLUDE simple_footer.html -->
|
||||
|
@ -5,4 +5,4 @@
|
||||
<p>{MESSAGE_TEXT}</p>
|
||||
</div>
|
||||
|
||||
<!-- INCLUDE simple_footer.html -->
|
||||
<!-- INCLUDE simple_footer.html -->
|
||||
|
@ -18,4 +18,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- INCLUDE simple_footer.html -->
|
||||
<!-- INCLUDE simple_footer.html -->
|
||||
|
@ -49,5 +49,3 @@ $template->assign_vars(array(
|
||||
$template->display('body');
|
||||
|
||||
garbage_collection();
|
||||
|
||||
?>
|
@ -237,5 +237,3 @@ foreach ($cache->obtain_hooks() as $hook)
|
||||
{
|
||||
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
|
||||
}
|
||||
|
||||
?>
|
@ -283,5 +283,3 @@ function unlock_cron()
|
||||
WHERE config_name = 'cron_lock' AND config_value = '" . $db->sql_escape(CRON_ID) . "'";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
?>
|
@ -413,5 +413,3 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
|
||||
unset($sql_ary);
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -143,5 +143,3 @@ function adjust_avatar($old_name, $midfix)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
?>
|
@ -170,5 +170,3 @@ $db->sql_freeresult($result);
|
||||
|
||||
// Done
|
||||
$db->sql_close();
|
||||
|
||||
?>
|
@ -122,5 +122,3 @@ $db->sql_freeresult($result);
|
||||
|
||||
// Done
|
||||
$db->sql_close();
|
||||
|
||||
?>
|
@ -128,5 +128,3 @@ $db->sql_freeresult($result);
|
||||
|
||||
// Done
|
||||
$db->sql_close();
|
||||
|
||||
?>
|
@ -126,5 +126,3 @@ $db->sql_freeresult($result);
|
||||
|
||||
// Done
|
||||
$db->sql_close();
|
||||
|
||||
?>
|
@ -126,4 +126,3 @@ $db->sql_freeresult($result);
|
||||
// Done
|
||||
$db->sql_close();
|
||||
echo 'done';
|
||||
?>
|
@ -48,5 +48,3 @@ echo 'FINISHED';
|
||||
|
||||
// Done
|
||||
$db->sql_close();
|
||||
|
||||
?>
|
@ -458,5 +458,3 @@ function make_user($username)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -72,5 +72,3 @@ do
|
||||
while ($start);
|
||||
|
||||
echo "<p><b>Done</b></p>\n";
|
||||
|
||||
?>
|
@ -58,5 +58,3 @@ while ($row = $db->sql_fetchrow($result))
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
echo "<p><b>Done</b></p>\n";
|
||||
|
||||
?>
|
@ -2047,5 +2047,3 @@ EOF;
|
||||
}
|
||||
|
||||
echo 'done';
|
||||
|
||||
?>
|
@ -543,5 +543,3 @@ fclose($fp);
|
||||
|
||||
echo '<br>Finished!';
|
||||
flush();
|
||||
|
||||
?>
|
@ -186,5 +186,3 @@ function rndm_username()
|
||||
|
||||
return $usernames[array_rand($usernames)];
|
||||
}
|
||||
|
||||
?>
|
@ -152,5 +152,3 @@ function download($url)
|
||||
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
?>
|
@ -240,5 +240,3 @@ function download($url)
|
||||
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
?>
|
@ -569,4 +569,4 @@ function cp_to_utf($cp)
|
||||
{
|
||||
return chr($cp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -137,4 +137,4 @@ function find_modules($dirname)
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@ -76,5 +76,3 @@ $db->sql_query($sql);
|
||||
//$db->sql_query("DROP TABLE {$table_prefix}attach_temp");
|
||||
|
||||
echo "<p><b>Done</b></p>\n";
|
||||
|
||||
?>
|
@ -205,5 +205,3 @@ foreach ($sql_ary as $sql)
|
||||
}
|
||||
|
||||
echo "<p><b>Done</b></p>\n";
|
||||
|
||||
?>
|
@ -1398,5 +1398,3 @@ function get_schema_struct()
|
||||
|
||||
return $schema_data;
|
||||
}
|
||||
|
||||
?>
|
@ -54,5 +54,3 @@ else
|
||||
flush();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
@ -80,5 +80,3 @@ echo 'www.URL: ' . $www_url . "<br />\n";
|
||||
// no schema and no authority
|
||||
$relative_url = "$segment$path_abempty(?:\?$query)?(?:\#$fragment)?";
|
||||
echo 'relative URL: ' . $relative_url . "<br />\n";
|
||||
|
||||
?>
|
65
phpBB/develop/remove-php-end-tags.py
Executable file
65
phpBB/develop/remove-php-end-tags.py
Executable file
@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env python
|
||||
# Remove ending PHP tags '?>'
|
||||
# @author Oleg Pudeyev
|
||||
# @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
|
||||
import sys, os, os.path, optparse
|
||||
|
||||
def error(message, code):
|
||||
print >>sys.stderr, message
|
||||
exit(code)
|
||||
|
||||
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option('-a', '--aggressive', help='Remove ending tags when they are followed by whitespace', action='store_true')
|
||||
options, args = parser.parse_args()
|
||||
|
||||
if len(args) != 1:
|
||||
parser.usage()
|
||||
error("Usage: remove-php-end-tags path", 2)
|
||||
|
||||
path = args[0]
|
||||
|
||||
if not os.path.exists(path):
|
||||
error("Path does not exist: %s" % path, 3)
|
||||
|
||||
if options.aggressive:
|
||||
import re
|
||||
|
||||
fix_re = re.compile(r'\s*\?>\s*$')
|
||||
def fix_content(content):
|
||||
content = fix_re.sub(r'\n', content)
|
||||
return content
|
||||
else:
|
||||
def fix_content(content):
|
||||
if content.endswith('?>'):
|
||||
content = content[:-2].strip() + "\n"
|
||||
return content
|
||||
|
||||
def process_file(path):
|
||||
f = open(path)
|
||||
try:
|
||||
content = f.read()
|
||||
finally:
|
||||
f.close()
|
||||
fixed_content = fix_content(content)
|
||||
if content != fixed_content:
|
||||
f = open(path, 'w')
|
||||
try:
|
||||
f.write(fixed_content)
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
def process_dir(path):
|
||||
for root, dirs, files in os.walk(path):
|
||||
if '.svn' in dirs:
|
||||
dirs.remove('.svn')
|
||||
for file in files:
|
||||
if file.endswith('.php'):
|
||||
path = os.path.join(root, file)
|
||||
process_file(path)
|
||||
|
||||
if os.path.isdir(path):
|
||||
process_dir(path)
|
||||
else:
|
||||
process_file(path)
|
@ -147,5 +147,3 @@ function add_bots($bots)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -116,5 +116,3 @@ function utf8_normalize_nfkc($strings)
|
||||
|
||||
return $strings;
|
||||
}
|
||||
|
||||
?>
|
@ -54,4 +54,3 @@ echo 'FINISHED';
|
||||
|
||||
// Done
|
||||
$db->sql_close();
|
||||
?>
|
@ -388,4 +388,4 @@ function cp_to_utf($cp)
|
||||
{
|
||||
return chr($cp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -309,5 +309,3 @@ else
|
||||
file_gc();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -85,5 +85,3 @@ $template->set_filenames(array(
|
||||
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
|
||||
|
||||
page_footer();
|
||||
|
||||
?>
|
@ -1489,6 +1489,3 @@ class phpbb_feed_topics_active extends phpbb_feed_topic_base
|
||||
$item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
@ -80,5 +80,3 @@ class acm extends acm_memory
|
||||
return apc_delete($this->key_prefix . $var);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -117,5 +117,3 @@ class acm extends acm_memory
|
||||
return eaccelerator_rm($this->key_prefix . $var);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -728,5 +728,3 @@ class acm
|
||||
return @unlink($filename);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -134,5 +134,3 @@ class acm extends acm_memory
|
||||
return $this->memcache->delete($this->key_prefix . $var);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -435,5 +435,3 @@ class acm_memory
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -152,5 +152,3 @@ class acm
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -117,5 +117,3 @@ class acm extends acm_memory
|
||||
return xcache_isset($this->key_prefix . $var);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1456,5 +1456,3 @@ class acp_attachments
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -248,5 +248,3 @@ class acp_ban
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -472,5 +472,3 @@ class acp_bbcodes
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -985,5 +985,3 @@ class acp_board
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -414,5 +414,3 @@ class acp_bots
|
||||
return ($row) ? false : true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -144,5 +144,3 @@ class acp_captcha
|
||||
exit_handler();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -2455,5 +2455,3 @@ function fgetd_seekless(&$fp, $delim, $read, $seek, $eof, $buffer = 8192)
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
?>
|
@ -104,5 +104,3 @@ class acp_disallow
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -258,5 +258,3 @@ class acp_email
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1950,5 +1950,3 @@ class acp_forums
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -794,5 +794,3 @@ class acp_groups
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -951,5 +951,3 @@ class acp_icons
|
||||
return $item_count;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -308,5 +308,3 @@ class acp_inactive
|
||||
$this->page_title = 'ACP_INACTIVE_USERS';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -127,5 +127,3 @@ class acp_jabber
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1469,5 +1469,3 @@ $lang = array_merge($lang, array(
|
||||
return $entry;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -173,5 +173,3 @@ class acp_logs
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -613,5 +613,3 @@ class acp_main
|
||||
$this->page_title = 'ACP_MAIN';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1061,5 +1061,3 @@ class acp_modules
|
||||
return $this->lang_name($target['module_langname']);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -567,5 +567,3 @@ class acp_permission_roles
|
||||
$auth_admin->acl_clear_prefetch();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1312,5 +1312,3 @@ class acp_permissions
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -80,5 +80,3 @@ class acp_php_info
|
||||
$template->assign_var('PHPINFO', $output);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1625,5 +1625,3 @@ class acp_profile
|
||||
return $sql;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -462,5 +462,3 @@ class acp_prune
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -236,5 +236,3 @@ class acp_ranks
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -371,5 +371,3 @@ class acp_reasons
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -625,5 +625,3 @@ class acp_search
|
||||
return $error;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -86,5 +86,3 @@ class acp_send_statistics
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user