diff options
Diffstat (limited to 'phpBB/develop')
28 files changed, 68 insertions, 49 deletions
diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php index 035c23f49c..5d9af3cad5 100644 --- a/phpBB/develop/add_permissions.php +++ b/phpBB/develop/add_permissions.php @@ -413,5 +413,3 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting) unset($sql_ary); } - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_avatars.php b/phpBB/develop/adjust_avatars.php index 81599e694b..dc4ae88f37 100644 --- a/phpBB/develop/adjust_avatars.php +++ b/phpBB/develop/adjust_avatars.php @@ -143,5 +143,3 @@ function adjust_avatar($old_name, $midfix) } return false; } - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_bbcodes.php b/phpBB/develop/adjust_bbcodes.php index f06f0112ab..5a7f065d7f 100644 --- a/phpBB/develop/adjust_bbcodes.php +++ b/phpBB/develop/adjust_bbcodes.php @@ -170,5 +170,3 @@ $db->sql_freeresult($result); // Done $db->sql_close(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_magic_urls.php b/phpBB/develop/adjust_magic_urls.php index 1430a47a12..c417c755cf 100644 --- a/phpBB/develop/adjust_magic_urls.php +++ b/phpBB/develop/adjust_magic_urls.php @@ -122,5 +122,3 @@ $db->sql_freeresult($result); // Done $db->sql_close(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_sizes.php b/phpBB/develop/adjust_sizes.php index 7d72813056..9b58389163 100644 --- a/phpBB/develop/adjust_sizes.php +++ b/phpBB/develop/adjust_sizes.php @@ -128,5 +128,3 @@ $db->sql_freeresult($result); // Done $db->sql_close(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_smilies.php b/phpBB/develop/adjust_smilies.php index 774c8834f6..ecc3461670 100644 --- a/phpBB/develop/adjust_smilies.php +++ b/phpBB/develop/adjust_smilies.php @@ -126,5 +126,3 @@ $db->sql_freeresult($result); // Done $db->sql_close(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_uids.php b/phpBB/develop/adjust_uids.php index d301f3cadb..3468475b8f 100644 --- a/phpBB/develop/adjust_uids.php +++ b/phpBB/develop/adjust_uids.php @@ -126,4 +126,3 @@ $db->sql_freeresult($result); // Done $db->sql_close(); echo 'done'; -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_usernames.php b/phpBB/develop/adjust_usernames.php index 1afa77af16..111a9a30d7 100644 --- a/phpBB/develop/adjust_usernames.php +++ b/phpBB/develop/adjust_usernames.php @@ -48,5 +48,3 @@ echo 'FINISHED'; // Done $db->sql_close(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/benchmark.php b/phpBB/develop/benchmark.php index 5bbe6f53be..c867b9262e 100644 --- a/phpBB/develop/benchmark.php +++ b/phpBB/develop/benchmark.php @@ -458,5 +458,3 @@ function make_user($username) } } - -?>
\ No newline at end of file diff --git a/phpBB/develop/calc_email_hash.php b/phpBB/develop/calc_email_hash.php index a67b0f52a3..0f7540ee7d 100644 --- a/phpBB/develop/calc_email_hash.php +++ b/phpBB/develop/calc_email_hash.php @@ -72,5 +72,3 @@ do while ($start); echo "<p><b>Done</b></p>\n"; - -?>
\ No newline at end of file diff --git a/phpBB/develop/change_smiley_ref.php b/phpBB/develop/change_smiley_ref.php index db65dd52d4..23a26951bf 100644 --- a/phpBB/develop/change_smiley_ref.php +++ b/phpBB/develop/change_smiley_ref.php @@ -58,5 +58,3 @@ while ($row = $db->sql_fetchrow($result)) $db->sql_freeresult($result); echo "<p><b>Done</b></p>\n"; - -?>
\ No newline at end of file diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 4fb7b0d8f7..c0ec876397 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -2047,5 +2047,3 @@ EOF; } echo 'done'; - -?>
\ No newline at end of file diff --git a/phpBB/develop/create_variable_overview.php b/phpBB/develop/create_variable_overview.php index 3782f53e4c..d2b7193df9 100644 --- a/phpBB/develop/create_variable_overview.php +++ b/phpBB/develop/create_variable_overview.php @@ -543,5 +543,3 @@ fclose($fp); echo '<br>Finished!'; flush(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/fill.php b/phpBB/develop/fill.php index 336e510d06..c9824e88e5 100644 --- a/phpBB/develop/fill.php +++ b/phpBB/develop/fill.php @@ -186,5 +186,3 @@ function rndm_username() return $usernames[array_rand($usernames)]; } - -?>
\ No newline at end of file diff --git a/phpBB/develop/generate_utf_casefold.php b/phpBB/develop/generate_utf_casefold.php index 89c4aec01a..4f764ca471 100644 --- a/phpBB/develop/generate_utf_casefold.php +++ b/phpBB/develop/generate_utf_casefold.php @@ -152,5 +152,3 @@ function download($url) echo "\n"; } - -?>
\ No newline at end of file diff --git a/phpBB/develop/generate_utf_confusables.php b/phpBB/develop/generate_utf_confusables.php index 0ffa9720c9..bc88e67ba9 100644 --- a/phpBB/develop/generate_utf_confusables.php +++ b/phpBB/develop/generate_utf_confusables.php @@ -240,5 +240,3 @@ function download($url) echo "\n"; } - -?>
\ No newline at end of file diff --git a/phpBB/develop/generate_utf_tables.php b/phpBB/develop/generate_utf_tables.php index 3d5188163d..dbef125803 100644 --- a/phpBB/develop/generate_utf_tables.php +++ b/phpBB/develop/generate_utf_tables.php @@ -569,4 +569,4 @@ function cp_to_utf($cp) { return chr($cp); } -}
\ No newline at end of file +} diff --git a/phpBB/develop/lang_duplicates.php b/phpBB/develop/lang_duplicates.php index 5be48f69f0..3ea841b6d6 100644 --- a/phpBB/develop/lang_duplicates.php +++ b/phpBB/develop/lang_duplicates.php @@ -137,4 +137,4 @@ function find_modules($dirname) ?> </body> -</html>
\ No newline at end of file +</html> diff --git a/phpBB/develop/merge_attachment_tables.php b/phpBB/develop/merge_attachment_tables.php index ae7fe57be4..aa6be0a26e 100644 --- a/phpBB/develop/merge_attachment_tables.php +++ b/phpBB/develop/merge_attachment_tables.php @@ -76,5 +76,3 @@ $db->sql_query($sql); //$db->sql_query("DROP TABLE {$table_prefix}attach_temp"); echo "<p><b>Done</b></p>\n"; - -?>
\ No newline at end of file diff --git a/phpBB/develop/merge_post_tables.php b/phpBB/develop/merge_post_tables.php index 3567a569c6..e7e22409a5 100644 --- a/phpBB/develop/merge_post_tables.php +++ b/phpBB/develop/merge_post_tables.php @@ -205,5 +205,3 @@ foreach ($sql_ary as $sql) } echo "<p><b>Done</b></p>\n"; - -?>
\ No newline at end of file diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php index 85da1dfa47..f61aa2e4f0 100644 --- a/phpBB/develop/mysql_upgrader.php +++ b/phpBB/develop/mysql_upgrader.php @@ -1398,5 +1398,3 @@ function get_schema_struct() return $schema_data; } - -?>
\ No newline at end of file diff --git a/phpBB/develop/nuke-db.php b/phpBB/develop/nuke-db.php index d7329c3f56..e1f64a6177 100644 --- a/phpBB/develop/nuke-db.php +++ b/phpBB/develop/nuke-db.php @@ -54,5 +54,3 @@ else flush(); } } -?> - diff --git a/phpBB/develop/regex.php b/phpBB/develop/regex.php index 8165ba1f21..46b6fff701 100644 --- a/phpBB/develop/regex.php +++ b/phpBB/develop/regex.php @@ -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"; - -?>
\ No newline at end of file diff --git a/phpBB/develop/remove-php-end-tags.py b/phpBB/develop/remove-php-end-tags.py new file mode 100755 index 0000000000..1707c6d519 --- /dev/null +++ b/phpBB/develop/remove-php-end-tags.py @@ -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) diff --git a/phpBB/develop/repair_bots.php b/phpBB/develop/repair_bots.php index c5aaa75d9b..790d3d9f2f 100644 --- a/phpBB/develop/repair_bots.php +++ b/phpBB/develop/repair_bots.php @@ -147,5 +147,3 @@ function add_bots($bots) } } } - -?>
\ No newline at end of file diff --git a/phpBB/develop/unicode_testing.php b/phpBB/develop/unicode_testing.php index 25a13d1325..ec3c71d078 100644 --- a/phpBB/develop/unicode_testing.php +++ b/phpBB/develop/unicode_testing.php @@ -116,5 +116,3 @@ function utf8_normalize_nfkc($strings) return $strings; } - -?>
\ No newline at end of file diff --git a/phpBB/develop/update_email_hash.php b/phpBB/develop/update_email_hash.php index 80fd4bbc17..57aebe3ca0 100644 --- a/phpBB/develop/update_email_hash.php +++ b/phpBB/develop/update_email_hash.php @@ -54,4 +54,3 @@ echo 'FINISHED'; // Done $db->sql_close(); -?>
\ No newline at end of file diff --git a/phpBB/develop/utf_normalizer_test.php b/phpBB/develop/utf_normalizer_test.php index 7705cd6851..463a274f66 100644 --- a/phpBB/develop/utf_normalizer_test.php +++ b/phpBB/develop/utf_normalizer_test.php @@ -388,4 +388,4 @@ function cp_to_utf($cp) { return chr($cp); } -}
\ No newline at end of file +} |