1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-05 08:17:47 +02:00

Merge branch 'ticket/igorw/9556' into develop

* ticket/igorw/9556:
  [ticket/9556] Drop php closing tags, add trailing newline

Conflicts:
	phpBB/includes/constants.php
This commit is contained in:
Nils Adermann
2010-12-13 16:35:55 +01:00
474 changed files with 274 additions and 737 deletions

View File

@@ -413,5 +413,3 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
unset($sql_ary);
}
?>

View File

@@ -143,5 +143,3 @@ function adjust_avatar($old_name, $midfix)
}
return false;
}
?>

View File

@@ -170,5 +170,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
?>

View File

@@ -122,5 +122,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
?>

View File

@@ -128,5 +128,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
?>

View File

@@ -126,5 +126,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
?>

View File

@@ -126,4 +126,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
echo 'done';
?>

View File

@@ -48,5 +48,3 @@ echo 'FINISHED';
// Done
$db->sql_close();
?>

View File

@@ -458,5 +458,3 @@ function make_user($username)
}
}
?>

View File

@@ -72,5 +72,3 @@ do
while ($start);
echo "<p><b>Done</b></p>\n";
?>

View File

@@ -58,5 +58,3 @@ while ($row = $db->sql_fetchrow($result))
$db->sql_freeresult($result);
echo "<p><b>Done</b></p>\n";
?>

View File

@@ -2047,5 +2047,3 @@ EOF;
}
echo 'done';
?>

View File

@@ -543,5 +543,3 @@ fclose($fp);
echo '<br>Finished!';
flush();
?>

View File

@@ -186,5 +186,3 @@ function rndm_username()
return $usernames[array_rand($usernames)];
}
?>

View File

@@ -152,5 +152,3 @@ function download($url)
echo "\n";
}
?>

View File

@@ -240,5 +240,3 @@ function download($url)
echo "\n";
}
?>

View File

@@ -569,4 +569,4 @@ function cp_to_utf($cp)
{
return chr($cp);
}
}
}

View File

@@ -137,4 +137,4 @@ function find_modules($dirname)
?>
</body>
</html>
</html>

View File

@@ -76,5 +76,3 @@ $db->sql_query($sql);
//$db->sql_query("DROP TABLE {$table_prefix}attach_temp");
echo "<p><b>Done</b></p>\n";
?>

View File

@@ -205,5 +205,3 @@ foreach ($sql_ary as $sql)
}
echo "<p><b>Done</b></p>\n";
?>

View File

@@ -1398,5 +1398,3 @@ function get_schema_struct()
return $schema_data;
}
?>

View File

@@ -54,5 +54,3 @@ else
flush();
}
}
?>

View File

@@ -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";
?>

View 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)

View File

@@ -147,5 +147,3 @@ function add_bots($bots)
}
}
}
?>

View File

@@ -116,5 +116,3 @@ function utf8_normalize_nfkc($strings)
return $strings;
}
?>

View File

@@ -54,4 +54,3 @@ echo 'FINISHED';
// Done
$db->sql_close();
?>

View File

@@ -388,4 +388,4 @@ function cp_to_utf($cp)
{
return chr($cp);
}
}
}