Author: chabotc
Date: Mon Feb 23 15:16:23 2009
New Revision: 747043

URL: http://svn.apache.org/viewvc?rev=747043&view=rev
Log:
SHINDIG-925 by Jakub Vrána - Meaningless regular expression in JsonDB

Modified:
    incubator/shindig/trunk/php/src/social/sample/JsonDbOpensocialService.php

Modified: 
incubator/shindig/trunk/php/src/social/sample/JsonDbOpensocialService.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social/sample/JsonDbOpensocialService.php?rev=747043&r1=747042&r2=747043&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social/sample/JsonDbOpensocialService.php 
(original)
+++ incubator/shindig/trunk/php/src/social/sample/JsonDbOpensocialService.php 
Mon Feb 23 15:16:23 2009
@@ -80,7 +80,7 @@
           throw new SocialSpiException("Could not read json db file: $jsonDb, 
check if the file exists & has proper permissions", 
ResponseError::$INTERNAL_ERROR);
         }
         $dbConfig = @file_get_contents($jsonDb);
-        $contents = preg_replace('/[^http:\/\/|^https:\/\/]\/\/.*$/m', '', 
preg_replace('@/\\*(?:.|[\\n\\r])*?\\*/@', '', $dbConfig));
+        $contents = preg_replace('/(?<!http:|https:)\/\/.*$/m', '', 
preg_replace('@/\\*(?:.|[\\n\\r])*?\\*/@', '', $dbConfig));
         $jsonDecoded = json_decode($contents, true);
         if ($jsonDecoded == $contents) {
           throw new SocialSpiException("Failed to decode the json db", 
ResponseError::$INTERNAL_ERROR);


Reply via email to