You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by ch...@apache.org on 2009/11/30 13:00:30 UTC

svn commit: r885391 - /incubator/shindig/trunk/php/src/gadgets/MakeRequest.php

Author: chabotc
Date: Mon Nov 30 12:00:30 2009
New Revision: 885391

URL: http://svn.apache.org/viewvc?rev=885391&view=rev
Log:
SHINDIG-1235 by Thiago Arrais - UTF-8 unescape in makeRequest drops letters that follow escape sequences

Modified:
    incubator/shindig/trunk/php/src/gadgets/MakeRequest.php

Modified: incubator/shindig/trunk/php/src/gadgets/MakeRequest.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/MakeRequest.php?rev=885391&r1=885390&r2=885391&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/MakeRequest.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/MakeRequest.php Mon Nov 30 12:00:30 2009
@@ -210,8 +210,8 @@
     if (preg_match("/&#[xX][0-9a-zA-Z]{2,8};/", $content)) {
       $content = preg_replace("/&#[xX]([0-9a-zA-Z]{2,8});/e", "'&#'.hexdec('$1').';'", $content);
     }
-    if (preg_match("/\\\\[uU][0-9a-zA-Z]{2,8}/", $content)) {
-      $content = preg_replace("/\\\\[uU]([0-9a-zA-Z]{2,8})/e", "'&#'.hexdec('$1').';'", $content);
+    if (preg_match("/\\\\(u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/", $content)) {
+      $content = preg_replace("/\\\\(u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/e", "'&#'.hexdec('$1').';'", $content);
     }
     return mb_decode_numericentity($content, array(0x0, 0xFFFF, 0, 0xFFFF), 'UTF-8');
   }