diff options
| author | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:34 +0100 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:34 +0100 |
| commit | 517f25353246f06eec7d1fdef90a04119a45bbbf (patch) | |
| tree | 7837b0e54fcd05f2f49a22a078b0f12cad864b30 /phpBB/develop | |
| parent | 89b37954f994a7cd517553d2d16686f91dcaae72 (diff) | |
| parent | 7068d8b462e388ea87883c5203a28fa6a8e4b6dc (diff) | |
| download | forums-517f25353246f06eec7d1fdef90a04119a45bbbf.tar forums-517f25353246f06eec7d1fdef90a04119a45bbbf.tar.gz forums-517f25353246f06eec7d1fdef90a04119a45bbbf.tar.bz2 forums-517f25353246f06eec7d1fdef90a04119a45bbbf.tar.xz forums-517f25353246f06eec7d1fdef90a04119a45bbbf.zip | |
Merge commit 'release-3.0-B5'
Diffstat (limited to 'phpBB/develop')
| -rw-r--r-- | phpBB/develop/create_schema_files.php | 19 | ||||
| -rw-r--r-- | phpBB/develop/generate_utf_casefold.php | 2 | ||||
| -rw-r--r-- | phpBB/develop/generate_utf_tables.php | 8 | ||||
| -rw-r--r-- | phpBB/develop/lang_duplicates.php | 2 | ||||
| -rw-r--r-- | phpBB/develop/regex.php | 74 | ||||
| -rw-r--r-- | phpBB/develop/search_fill.php | 2 | ||||
| -rw-r--r-- | phpBB/develop/utf_normalizer_test.php | 8 |
7 files changed, 94 insertions, 21 deletions
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 60324d94a8..0f9c36bb09 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -949,6 +949,7 @@ function get_schema_struct() 'session_id' => array('CHAR:32', ''), 'confirm_type' => array('TINT:3', 0), 'code' => array('VCHAR:8', ''), + 'seed' => array('UINT:10', 0), ), 'PRIMARY_KEY' => array('session_id', 'confirm_id'), 'KEYS' => array( @@ -1043,9 +1044,9 @@ function get_schema_struct() 'enable_icons' => array('BOOL', 1), 'enable_prune' => array('BOOL', 0), 'prune_next' => array('TIMESTAMP', 0), - 'prune_days' => array('TINT:4', 0), - 'prune_viewed' => array('TINT:4', 0), - 'prune_freq' => array('TINT:4', 0), + 'prune_days' => array('UINT', 0), + 'prune_viewed' => array('UINT', 0), + 'prune_freq' => array('UINT', 0), ), 'PRIMARY_KEY' => 'forum_id', 'KEYS' => array( @@ -1326,7 +1327,7 @@ function get_schema_struct() 'rule_user_id' => array('UINT', 0), 'rule_group_id' => array('UINT', 0), 'rule_action' => array('UINT', 0), - 'rule_folder_id' => array('INT:4', 0), + 'rule_folder_id' => array('INT:11', 0), ), 'PRIMARY_KEY' => 'rule_id', 'KEYS' => array( @@ -1345,7 +1346,7 @@ function get_schema_struct() 'pm_replied' => array('BOOL', 0), 'pm_marked' => array('BOOL', 0), 'pm_forwarded' => array('BOOL', 0), - 'folder_id' => array('INT:4', 0), + 'folder_id' => array('INT:11', 0), ), 'KEYS' => array( 'msg_id' => array('INDEX', 'msg_id'), @@ -1487,6 +1488,7 @@ function get_schema_struct() 'session_time' => array('TIMESTAMP', 0), 'session_ip' => array('VCHAR:40', ''), 'session_browser' => array('VCHAR:150', ''), + 'session_forwarded_for' => array('VCHAR:255', ''), 'session_page' => array('VCHAR_UNI', ''), 'session_viewonline' => array('BOOL', 1), 'session_autologin' => array('BOOL', 0), @@ -1876,7 +1878,7 @@ function get_schema_struct() 'user_allow_viewonline' => array('BOOL', 1), 'user_allow_viewemail' => array('BOOL', 1), 'user_allow_massemail' => array('BOOL', 1), - 'user_options' => array('UINT:11', 893), + 'user_options' => array('UINT:11', 895), 'user_avatar' => array('VCHAR', ''), 'user_avatar_type' => array('TINT:2', 0), 'user_avatar_width' => array('USINT', 0), @@ -1932,10 +1934,7 @@ function get_schema_struct() 'friend' => array('BOOL', 0), 'foe' => array('BOOL', 0), ), - 'KEYS' => array( - 'user_id' => array('INDEX', 'user_id'), - 'zebra_id' => array('INDEX', 'zebra_id'), - ), + 'PRIMARY_KEY' => array('user_id', 'zebra_id'), ); return $schema_data; diff --git a/phpBB/develop/generate_utf_casefold.php b/phpBB/develop/generate_utf_casefold.php index 68cc83d880..d9aace10ce 100644 --- a/phpBB/develop/generate_utf_casefold.php +++ b/phpBB/develop/generate_utf_casefold.php @@ -89,7 +89,7 @@ function my_var_export($var) return 'array(' . implode(',', $lines) . ')'; } - elseif (is_string($var)) + else if (is_string($var)) { return "'" . str_replace(array('\\', "'"), array('\\\\', "\\'"), $var) . "'"; } diff --git a/phpBB/develop/generate_utf_tables.php b/phpBB/develop/generate_utf_tables.php index 1d7fbc1d67..ffad9106d6 100644 --- a/phpBB/develop/generate_utf_tables.php +++ b/phpBB/develop/generate_utf_tables.php @@ -320,7 +320,7 @@ while ($line = fgets($fp, 1024)) */ $map[$cp] = strtolower($capture[1]); } - elseif (isset($m[13][0])) + else if (isset($m[13][0])) { /** * If the letter has a lowercased form, use it @@ -455,7 +455,7 @@ function my_var_export($var) return 'array(' . implode(',', $lines) . ')'; } - elseif (is_string($var)) + else if (is_string($var)) { return "'" . str_replace(array('\\', "'"), array('\\\\', "\\'"), $var) . "'"; } @@ -544,11 +544,11 @@ function cp_to_utf($cp) { return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); } - elseif ($cp > 0x7FF) + else if ($cp > 0x7FF) { return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); } - elseif ($cp > 0x7F) + else if ($cp > 0x7F) { return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F)); } diff --git a/phpBB/develop/lang_duplicates.php b/phpBB/develop/lang_duplicates.php index 666a9a084e..5a77c79543 100644 --- a/phpBB/develop/lang_duplicates.php +++ b/phpBB/develop/lang_duplicates.php @@ -60,7 +60,7 @@ while ($module = array_shift($keys)) $compare = "Equal"; $equal++; } - elseif (strcasecmp($kkeys[$module][$dup], $kkeys[$other_module][$dup]) == 0) + else if (strcasecmp($kkeys[$module][$dup], $kkeys[$other_module][$dup]) == 0) { $compare = "Differ in case"; $case++; diff --git a/phpBB/develop/regex.php b/phpBB/develop/regex.php new file mode 100644 index 0000000000..7abecc9650 --- /dev/null +++ b/phpBB/develop/regex.php @@ -0,0 +1,74 @@ +<?php + +// IP regular expressions + +$dec_octet = '(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])'; +$h16 = '[\dA-F]{1,4}'; +$ipv4 = "(?:$dec_octet\.){3}$dec_octet"; +$ls32 = "(?:$h16:$h16|$ipv4)"; + +$ipv6_construct = array( + array(false, '', '{6}', $ls32), + array(false, '::', '{5}', $ls32), + array('', ':', '{4}', $ls32), + array('{1,2}', ':', '{3}', $ls32), + array('{1,3}', ':', '{2}', $ls32), + array('{1,4}', ':', '', $ls32), + array('{1,5}', ':', false, $ls32), + array('{1,6}', ':', false, $h16), + array('{1,7}', ':', false, '') +); + +$ipv6 = '(?:'; +foreach ($ipv6_construct as $ip_type) +{ + $ipv6 .= '(?:'; + if ($ip_type[0] !== false) + { + $ipv6 .= "(?:$h16:)" . $ip_type[0]; + } + $ipv6 .= $ip_type[1]; + if ($ip_type[2] !== false) + { + $ipv6 .= "(?:$h16:)" . $ip_type[2]; + } + $ipv6 .= $ip_type[3] . ')|'; +} +$ipv6 = substr($ipv6, 0, -1) . ')'; + +echo 'IPv4: ' . $ipv4 . "<br />\nIPv6: " . $ipv6 . "<br />\n"; + +// URL regular expressions + +$pct_encoded = "%[\dA-F]{2}"; +$unreserved = 'a-z0-9\-._~'; +$sub_delims = '!$&\'()*+,;='; +$pchar = "(?:[$unreserved$sub_delims:@|]+|$pct_encoded)"; // rfc: no "|" + +$scheme = '[a-z][a-z\d+\-.]*'; +$reg_name = "(?:[$unreserved$sub_delims|@]+|$pct_encoded)+"; // rfc: * instead of + and no "|" and no "@" (included instead of userinfo +//$userinfo = "(?:(?:[$unreserved$sub_delims:]+|$pct_encoded))*"; +$ipv4_simple = '[0-9.]+'; +$ipv6_simple = '\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\]'; +$host = "(?:$reg_name|$ipv4_simple|$ipv6_simple)"; +$port = '\d*'; +//$authority = "(?:$userinfo@)?$host(?::$port)?"; +$authority = "$host(?::$port)?"; +$segment = "$pchar*"; +$path_abempty = "(?:/$segment)*"; +$hier_part = "/{2}$authority$path_abempty"; +$query = "(?:[$unreserved$sub_delims:@/?|]+|$pct_encoded)*"; // pchar | "/" | "?", rfc: no "|" +$fragment = $query; + +$url = "$scheme:$hier_part(?:\?$query)?(?:\#$fragment)?"; +echo 'URL: ' . $url . "<br />\n"; + +// no scheme, shortened authority, but host has to start with www. +$www_url = "www\.$reg_name(?::$port)?$path_abempty(?:\?$query)?(?:\#$fragment)?"; +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/search_fill.php b/phpBB/develop/search_fill.php index 8bb656b901..1ab74f562c 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -82,7 +82,7 @@ for(;$postcounter <= $max_post_id; $postcounter += $batchsize) $rowset = $db->sql_fetchrowset($result); $db->sql_freeresult($result); - $post_rows = count($rowset); + $post_rows = sizeof($rowset); if( $post_rows ) { diff --git a/phpBB/develop/utf_normalizer_test.php b/phpBB/develop/utf_normalizer_test.php index 63c73c05e4..2026d3d4c8 100644 --- a/phpBB/develop/utf_normalizer_test.php +++ b/phpBB/develop/utf_normalizer_test.php @@ -71,7 +71,7 @@ $test_suite = array( require_once($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx); $i = $n = 0; -$failed = FALSE; +$failed = false; $tested_chars = array(); $fp = fopen($phpbb_root_path . 'develop/NormalizationTest.txt', 'rb'); @@ -127,7 +127,7 @@ while (!feof($fp)) if (strcmp($utf_expected, $utf_result)) { - $failed = TRUE; + $failed = true; $hex_result = utf_to_hexseq($utf_result); echo "\nFAILED $expected == $form($test) ($hex_expected != $hex_result)"; @@ -365,11 +365,11 @@ function cp_to_utf($cp) { return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); } - elseif ($cp > 0x7FF) + else if ($cp > 0x7FF) { return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); } - elseif ($cp > 0x7F) + else if ($cp > 0x7F) { return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F)); } |
