ID:          11244
 Comment by:  news-asia298 at hotmail dot com
 Reported By: php2eran at tromer dot org
 Status:      Closed
 Bug Type:    *Languages/Translation
 PHP Version: 4.0.5
 New Comment:

<a href=http://great-sexy-pantyhos.da.ru>news asia</a>


Previous Comments:
------------------------------------------------------------------------

[2002-03-26 02:57:24] [EMAIL PROTECTED]

Fixed in CVS.

------------------------------------------------------------------------

[2001-06-01 16:30:08] php2eran at tromer dot org

There's a problem with the hebrev() and hebrevc() functions (PHP 4.0.5
and earlier).
These functions convert logical Hebrew text to visual Hebrew text
(generally by byte-reversing the blocks of Hebrew letters but not of
English letters but there are a lot of gotchas).

There's a problem in the handling of the characters '[', ']','{', '}',
'<', '>': they come out reversed when they appear in a Hebrew block,
compared to the logical-to-visual algorithm used in MSIE (tested: v5
and v5.5). Specifically, text entered using MSIE edit boxes and then
hebrev()ed will have the reversal problem. Since MSIE is by far the
most popular browser for Hebrew users (due to deficient Hebrew support
in alternatives), this should be considered a bug.

The problem would occur for the normal parenthesis '(' and ')' as well,
but the current implementation of hebrev() handles this case
specifically by exchanging these characters when in a Hebrew block. The
same method will work for the '[]{}<>' characters. Note that since
exchanging should be done only in Hebrew blocks, it cannot be easily
done using the PHP code that calls hebrev() with guaranteed
consistency.

hebrev() and hebrevc() are implemented in php_hebrev in
ext/standard/string.c. The following simple patch does the character
exchanging described above. I've tested it extensively and it seems
compatible with the MSIE algorithm. However, for backward compatibility
it would be prudent to make this change in behavior only when instructed
so via an optional parameter (sorry, I don't know how to implement
this).
---------------------------------------------
*** string.c.org        Fri Jun  1 22:55:21 2001
--- string.c    Fri Jun  1 22:56:38 2001
***************
*** 2387,2392 ****
--- 2387,2410 ----
                                        case ')':
                                                *target = '(';
                                                break;
+                                       case '[':
+                                               *target = ']';
+                                               break;
+                                       case ']':
+                                               *target = '[';
+                                               break;
+                                       case '<':
+                                               *target = '>';
+                                               break;
+                                       case '>':
+                                               *target = '<';
+                                               break;
+                                       case '{':
+                                               *target = '}';
+                                               break;
+                                       case '}':
+                                               *target = '{';
+                                               break;
                                        default:
                                                break;
                                }
---------------------------------------------


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=11244&edit=1

Reply via email to