|
From: Paul S. O. <ps...@us...> - 2001-11-26 01:37:28
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv24858
Modified Files:
posting.php
Log Message:
Convert accents on chars into 'equivalent' plain letters
Index: posting.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/posting.php,v
retrieving revision 1.110
retrieving revision 1.111
diff -C2 -r1.110 -r1.111
*** posting.php 2001/11/25 23:31:03 1.110
--- posting.php 2001/11/26 01:37:25 1.111
***************
*** 38,43 ****
--- 38,52 ----
static $later_replace = array(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ");
+ static $sgml_match = array(" ", "ß", "à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ");
+ static $sgml_replace = array(" ", "s", "a", "a", "a", "a", "a", "a", "a", "c", "e", "e", "e", "e", "i", "i", "i", "i", "o", "n", "i", "i", "i", "i", "i", "i", "u", "u", "u", "u", "y", "t", "y");
+
+ static $accent_match = array("ß", "à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ");
+ static $accent_replace = array("s", "a", "a", "a", "a", "a", "a", "a", "c", "e", "e", "e", "e", "i", "i", "i", "i", "o", "n", "i", "i", "i", "i", "i", "i", "u", "u", "u", "u", "y", "t", "y");
+
$entry = " " . stripslashes(strip_tags(strtolower($entry))) . " ";
+ $entry = str_replace($sgml_match, $sgml_match, $entry);
+ $entry = str_replace($accent_match, $accent_replace, $entry);
+
$entry = preg_replace("/[\n\r]/is", " ", $entry);
$entry = preg_replace("/\b[a-z0-9]+:\/\/[a-z0-9\.\-]+(\/[a-z0-9\?\.%_\-\+=&\/]+)?/si", " ", $entry);
***************
*** 80,83 ****
--- 89,93 ----
function split_words(&$entry)
{
+ $split_entries = array();
preg_match_all("/\b(\w[\w']*\w+|\w+?)\b/", $entry, $split_entries);
***************
*** 1030,1037 ****
if( $submit && $mode != "vote" )
{
! if( !empty($HTTP_POST_VARS['username']) )
{
- $post_username = trim(strip_tags($HTTP_POST_VARS['username']));
-
if( !validate_username(stripslashes($post_username)) )
{
--- 1040,1046 ----
if( $submit && $mode != "vote" )
{
! $post_username = trim(strip_tags($HTTP_POST_VARS['username']));
! if( !empty($post_username) )
{
if( !validate_username(stripslashes($post_username)) )
{
***************
*** 1049,1053 ****
}
! $post_subject = trim(strip_tags($HTTP_POST_VARS['subject']));
if( $mode == 'newtopic' && empty($post_subject) )
{
--- 1058,1062 ----
}
! $post_subject = trim(strip_tags(str_replace(" ", " ", $HTTP_POST_VARS['subject'])));
if( $mode == 'newtopic' && empty($post_subject) )
{
***************
*** 1060,1064 ****
}
! if( !empty($HTTP_POST_VARS['message']) )
{
if( !$error )
--- 1069,1074 ----
}
! $post_message = trim(str_replace(" ", " ", $HTTP_POST_VARS['message']));
! if( !empty($post_message) )
{
if( !$error )
***************
*** 1068,1074 ****
$bbcode_uid = make_bbcode_uid();
}
-
- $post_message = prepare_message($HTTP_POST_VARS['message'], $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
}
}
--- 1078,1083 ----
$bbcode_uid = make_bbcode_uid();
}
+ $post_message = prepare_message($post_message, $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
}
}
|