diff options
author | David M <davidmj@users.sourceforge.net> | 2006-07-01 06:30:49 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2006-07-01 06:30:49 +0000 |
commit | 3efe7ffb1fed7fbc858699a13e2bdf28c68badd3 (patch) | |
tree | e6ce9745153e0a48f2897bb4d2bc98d8503ac9a0 /phpBB | |
parent | 30563df3455e93a25a46b7fcd9891abb7e9cc895 (diff) | |
download | forums-3efe7ffb1fed7fbc858699a13e2bdf28c68badd3.tar forums-3efe7ffb1fed7fbc858699a13e2bdf28c68badd3.tar.gz forums-3efe7ffb1fed7fbc858699a13e2bdf28c68badd3.tar.bz2 forums-3efe7ffb1fed7fbc858699a13e2bdf28c68badd3.tar.xz forums-3efe7ffb1fed7fbc858699a13e2bdf28c68badd3.zip |
bugs? bugs.
git-svn-id: file:///svn/phpbb/trunk@6133 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/adm/style/acp_bbcodes.html | 4 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_bbcodes.php | 7 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_captcha.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_database.php | 2 | ||||
-rw-r--r-- | phpBB/includes/captcha/captcha_gd.php | 40 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_confirm.php | 2 | ||||
-rw-r--r-- | phpBB/language/en/acp/posting.php | 2 |
7 files changed, 31 insertions, 28 deletions
diff --git a/phpBB/adm/style/acp_bbcodes.html b/phpBB/adm/style/acp_bbcodes.html index 7a0f4922a2..0714b6f106 100644 --- a/phpBB/adm/style/acp_bbcodes.html +++ b/phpBB/adm/style/acp_bbcodes.html @@ -45,7 +45,7 @@ <br /> - <table cellspacing="1"> + <table cellspacing="1" id="down"> <thead> <tr> <th colspan="2">{L_TOKENS}</th> @@ -76,7 +76,7 @@ <p>{L_ACP_BBCODES_EXPLAIN}</p> - <table cellspacing="1"> + <table cellspacing="1" id="down"> <thead> <tr> <th>{L_BBCODE_TAG}</th> diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index edc8a594da..675048327a 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -89,6 +89,7 @@ class acp_bbcodes 'U_BACK' => $this->u_action, 'U_ACTION' => $this->u_action . '&action=' . (($action == 'add') ? 'create' : 'modify') . (($bbcode_id) ? "&bbcode=$bbcode_id" : ''), + 'L_BBCODE_USAGE_EXPLAIN'=> sprintf($user->lang['BBCODE_USAGE_EXPLAIN'], '<a href="#down">', '</a>'), 'BBCODE_MATCH' => $bbcode_match, 'BBCODE_TPL' => $bbcode_tpl, 'DISPLAY_ON_POSTING' => $display_on_posting) @@ -278,8 +279,8 @@ class acp_bbcodes { $token_type = $m[1][$n]; - reset($tokens[$token_type]); - list($match, $replace) = each($tokens[$token_type]); + reset($tokens[strtoupper($token_type)]); + list($match, $replace) = each($tokens[strtoupper($token_type)]); // Pad backreference numbers from tokens if (preg_match_all('/(?<!\\\\)\$([0-9]+)/', $replace, $repad)) @@ -337,7 +338,7 @@ class acp_bbcodes } // Lowercase tags - $bbcode_tag = preg_replace('/.*?\[([a-z]+=?).*/i', '$1', $bbcode_match); + $bbcode_tag = preg_replace('/.*?\[([a-z0-9_-]+=?).*/i', '$1', $bbcode_match); $fp_match = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $fp_match); $fp_replace = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $fp_replace); $sp_match = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $sp_match); diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index dc28eb1583..e20937102c 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -99,6 +99,8 @@ class acp_captcha trigger_error($user->lang['BAD_POLICY']); } + $user->add_lang('ucp'); + include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx); $captcha = new captcha(); diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index fbe4f78aca..5d023d6205 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -42,7 +42,7 @@ class acp_database $type = request_var('type', ''); $table = request_var('table', array('')); $format = request_var('method', ''); - $where = request_var('WHERE', ''); + $where = request_var('where', ''); $store = $download = $structure = $schema_data = false; diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php index 05fb57c9c1..ac5ffcbb20 100644 --- a/phpBB/includes/captcha/captcha_gd.php +++ b/phpBB/includes/captcha/captcha_gd.php @@ -97,7 +97,7 @@ class captcha $char = hexdec(substr($seed, ($y * 4) + $x, 1)); if (!($char >> 2)) { - switch ($char % 4) + switch ($char & 3) { case 0: $shape = 'Circle'; @@ -125,20 +125,20 @@ class captcha for ($i = 0; $i < 6; ++$i) { $cells = hexdec(substr($seed, 20 + ($i * 2), 2)); - $x1 = $cells % 4; + $x1 = $cells & 3; $cells = $cells >> 2; - $y1 = $cells % 4; + $y1 = $cells & 3; $cells = $cells >> 2; - $x2 = $cells % 4; + $x2 = $cells & 3; $cells = $cells >> 2; - $y2 = $cells % 4; + $y2 = $cells & 3; $x1_real = $x_min + (($x1 + 0.5) * $x_size); $y1_real = $y_min + (($y1 + 0.5) * $y_size); $x2_real = $x_min + (($x2 + 0.5) * $x_size); $y2_real = $y_min + (($y2 + 0.5) * $y_size); if ($thickness > 1) { - imagesetthickness($img,$thickness); + imagesetthickness($img, $thickness); } imageline($img, $x1_real, $y1_real, $x2_real, $y2_real, $colors[array_rand($colors)]); if ($thickness > 1) @@ -203,7 +203,7 @@ class captcha $patterns = array('', '', '', ''); for ($i = 32; $i > 0; --$i) { - $patterns[$i % 4] .= str_pad(dechex(mt_rand(0, 65535)), 4, '0', STR_PAD_LEFT); + $patterns[$i & 3] .= str_pad(dechex(mt_rand(0, 65535)), 4, '0', STR_PAD_LEFT); } $char_class = $this->captcha_char('char_ttf'); @@ -341,11 +341,11 @@ class captcha { $distance = min($distance, sqrt(pow($s, 2) + pow($r, 2))); } - elseif ($s < $vector[6]) + else if ($s < $vector[6]) { $distance = min($distance, $r); } - elseif ($s < $vector[6] + $range) + else if ($s < $vector[6] + $range) { $distance = min($distance, sqrt(pow($s - $vector[6], 2) + pow($r, 2))); } @@ -358,7 +358,7 @@ class captcha $dx = $meta_x - $vector[1]; $dy = -($meta_y - $vector[2]); // because our arcs are upside-down - if ( abs($dx) > abs($dy) ) + if (abs($dx) > abs($dy)) { $phi = rad2deg(atan(($dy * $vector[3]) / ($dx * $vector[4]))); $phi += ($dx < 0) ? 180 : 360; @@ -575,10 +575,10 @@ class captcha { for ($i = 0, $size = sizeof($spares[$k]); $i < $size; ++$i ) { - imagefilledellipse($img, $xs[$spares[$k][$i]], $ys[$spares[$k][$i]], 20, 20, $colors[($red + $k + 1) % 4]); + imagefilledellipse($img, $xs[$spares[$k][$i]], $ys[$spares[$k][$i]], 20, 20, $colors[($red + $k + 1) & 3]); if ($i) { - imageline($img, $xs[$spares[$k][$i - 1]], $ys[$spares[$k][$i - 1]], $xs[$spares[$k][$i]], $ys[$spares[$k][$i]], $colors[($red + $k + 1) % 4]); + imageline($img, $xs[$spares[$k][$i - 1]], $ys[$spares[$k][$i - 1]], $xs[$spares[$k][$i]], $ys[$spares[$k][$i]], $colors[($red + $k + 1) & 3]); } } } @@ -794,7 +794,7 @@ class captcha { if ($map['data'][$letter][$y][$x]) { - $plane[$y + $plane_offset_y + (($c % 2) ? 1 : -1)][$x + $plane_offset_x] = true; + $plane[$y + $plane_offset_y + (($c & 1) ? 1 : -1)][$x + $plane_offset_x] = true; } } } @@ -827,7 +827,7 @@ class captcha for ($y = 1; $y <= $full_y; ++$y) { // swap buffers - $buffer_cur = $y % 2; + $buffer_cur = $y & 1; $buffer_prev = 1 - $buffer_cur; $prev_height = $this->wave_height(0, $y, $subdivision_factor); @@ -869,7 +869,7 @@ class captcha $diag_up = (empty($plane[$y_index_old][$x_index_new]) == empty($plane[$y_index_new][$x_index_old])); // natural switching - $mode = ($x + $y) % 2; + $mode = ($x + $y) & 1; // override if it requires it if ($diag_down != $diag_up) @@ -969,7 +969,7 @@ class captcha $characters[$i]->drawchar($char_size, $offset, $yoffset, $img, $background, $fontcolors); $offset += $dimm[2]; $offset -= (($dimm[2] - $dimm[0]) * $overlap_factor); - $yoffset += ($i % 2) ? ((1 - $overlap_factor) * ($dimm[3] - $dimm[1])) : ((1 - $overlap_factor) * ($dimm[1] - $dimm[3])); + $yoffset += ($i & 1) ? ((1 - $overlap_factor) * ($dimm[3] - $dimm[1])) : ((1 - $overlap_factor) * ($dimm[1] - $dimm[3])); } // Add some medium pixel noise @@ -1041,15 +1041,15 @@ class captcha case 'noise_pixel_heavy': - for ($x = $min_x; $x < $max_x; $x += mt_rand(9, 18)) + for ($x = $min_x; $x < $max_x; $x += mt_rand(4, 9)) { - for ($y = $min_y; $y < $max_y; $y += mt_rand(4, 9)) + for ($y = $min_y; $y < $max_y; $y++) { imagesetpixel($img, $x, $y, $non_font[array_rand($non_font)]); } } - for ($y = $min_y; $y < $max_y; $y++) + for ($y = $min_y; $y < $max_y; $y+= mt_rand(4, 9)) { for ($x = $min_x; $x < $max_x; $x++) { @@ -1145,7 +1145,7 @@ class captcha $character_classes[] = 'char_ttf'; } } -//$character_classes = array('char_dots'); + // Use the module $override, else a random picked one... $class = ($override !== false && in_array($override, $character_classes)) ? $override : $character_classes[array_rand($character_classes)]; diff --git a/phpBB/includes/ucp/ucp_confirm.php b/phpBB/includes/ucp/ucp_confirm.php index 37f9d485f9..618ec6b96d 100644 --- a/phpBB/includes/ucp/ucp_confirm.php +++ b/phpBB/includes/ucp/ucp_confirm.php @@ -59,7 +59,7 @@ class ucp_confirm if (function_exists('imagettfbbox') && function_exists('imagettftext')) { - $policy_modules += array('policy_overlap', 'policy_shape', 'policy_cells', 'policy_stencil', 'policy_composite'); + $policy_modules = array_merge($policy_modules, array('policy_overlap', 'policy_shape', 'policy_cells', 'policy_stencil', 'policy_composite')); } foreach ($policy_modules as $key => $name) diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php index cf9bf32c44..1258e43eb3 100644 --- a/phpBB/language/en/acp/posting.php +++ b/phpBB/language/en/acp/posting.php @@ -41,7 +41,7 @@ $lang = array_merge($lang, array( 'BBCODE_TAG' => 'Tag', 'BBCODE_USAGE' => 'BBCode usage', 'BBCODE_USAGE_EXAMPLE' => '[colour={COLOR}]{TEXT}[/colour]<br /><br />[font={TEXT1}]{TEXT2}[/font]', - 'BBCODE_USAGE_EXPLAIN' => 'Here you define how to use the bbcode. Replace any variable input by the corresponding token (see below)', + 'BBCODE_USAGE_EXPLAIN' => 'Here you define how to use the bbcode. Replace any variable input by the corresponding token (%ssee below%s)', 'EXAMPLE' => 'Example:', 'EXAMPLES' => 'Examples:', |