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/05/14 00:56:58 UTC

svn commit: r774581 - in /incubator/shindig/trunk/php/src: common/RemoteContentRequest.php common/sample/BasicBlobCrypter.php gadgets/GadgetFeatureRegistry.php gadgets/SigningFetcher.php

Author: chabotc
Date: Wed May 13 22:56:58 2009
New Revision: 774581

URL: http://svn.apache.org/viewvc?rev=774581&view=rev
Log:
Removed the usage of some PHP 5.3 depreciated functions, works fine with PHP5.3.0RC2 now

Modified:
    incubator/shindig/trunk/php/src/common/RemoteContentRequest.php
    incubator/shindig/trunk/php/src/common/sample/BasicBlobCrypter.php
    incubator/shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php
    incubator/shindig/trunk/php/src/gadgets/SigningFetcher.php

Modified: incubator/shindig/trunk/php/src/common/RemoteContentRequest.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/common/RemoteContentRequest.php?rev=774581&r1=774580&r2=774581&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/common/RemoteContentRequest.php (original)
+++ incubator/shindig/trunk/php/src/common/RemoteContentRequest.php Wed May 13 22:56:58 2009
@@ -62,7 +62,7 @@
    * @var string
    */
   private $authType;
-  
+
   /**
    * @var OAuthRequestParams
    */
@@ -290,11 +290,11 @@
   public function getToken() {
     return $this->token;
   }
-  
+
   public function setOAuthRequestParams(OAuthRequestParams $params) {
     $this->oauthParams = $params;
   }
-  
+
   /**
    * @return OAuthRequestParams
    */
@@ -352,7 +352,7 @@
   public function isStrictNoCache() {
     $cacheControl = $this->getResponseHeader('Cache-Control');
     if ($cacheControl != null) {
-      $directives = split(',', $cacheControl);
+      $directives = explode(',', $cacheControl);
       foreach ($directives as $directive) {
         if (strcasecmp($directive, 'no-cache') == 0
             || strcasecmp($directive, 'no-store') == 0

Modified: incubator/shindig/trunk/php/src/common/sample/BasicBlobCrypter.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/common/sample/BasicBlobCrypter.php?rev=774581&r1=774580&r2=774581&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/common/sample/BasicBlobCrypter.php (original)
+++ incubator/shindig/trunk/php/src/common/sample/BasicBlobCrypter.php Wed May 13 22:56:58 2009
@@ -115,12 +115,7 @@
 
   private function deserialize($plain) {
     $map = array();
-    $items = split("[&=]", $plain);
-    for ($i = 0; $i < count($items);) {
-      $key = urldecode($items[$i ++]);
-      $value = urldecode($items[$i ++]);
-      $map[$key] = $value;
-    }
+    parse_str($plain, $map);
     return $map;
   }
 

Modified: incubator/shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php?rev=774581&r1=774580&r2=774581&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php Wed May 13 22:56:58 2009
@@ -156,7 +156,7 @@
    */
   private function processFile($file) {
     $feature = null;
-    if (File::exists($file)) {
+    if (!empty($file) && File::exists($file)) {
       if (($content = file_get_contents($file))) {
         $feature = $this->parse($content, dirname($file));
       }

Modified: incubator/shindig/trunk/php/src/gadgets/SigningFetcher.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/SigningFetcher.php?rev=774581&r1=774580&r2=774581&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/SigningFetcher.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/SigningFetcher.php Wed May 13 22:56:58 2009
@@ -247,7 +247,6 @@
     if ($canonParamName == "output" || $canonParamName == "httpmethod" || $canonParamName == "authz" || $canonParamName == "st" || $canonParamName == "headers" || $canonParamName == "url" || $canonParamName == "contenttype" || $canonParamName == "postdata" || $canonParamName == "numentries" || $canonParamName == "getsummaries" || $canonParamName == "signowner" || $canonParamName == "signviewer" || $canonParamName == "gadget" || $canonParamName == "bypassspeccache" || substr($canonParamName, 0, 5) == "oauth" || substr($canonParamName, 0, 6) == "xoauth" || substr($canonParamName, 0, 9) == "opensocial") {
       return false;
     }
-    // make a last sanity check on the key of the data by using a regular expression
-    return ereg(SigningFetcher::$ALLOWED_PARAM_NAME, $canonParamName);
+    return true;
   }
 }