]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
strip whitespace from me:data and me:sig (per spec)
authorJames Walker <walkah@walkah.net>
Sat, 7 Aug 2010 13:48:21 +0000 (09:48 -0400)
committerJames Walker <walkah@walkah.net>
Sat, 7 Aug 2010 13:48:21 +0000 (09:48 -0400)
plugins/OStatus/lib/magicenvelope.php

index 3bdf24b3178abc235303b29d036e4670a8d9a294..967e5f6d17683fe235930f06207be095e91de711 100644 (file)
@@ -210,13 +210,13 @@ class MagicEnvelope
         }
 
         $data_element = $env_element->getElementsByTagNameNS(MagicEnvelope::NS, 'data')->item(0);
-        
+        $sig_element = $env_element->getElementsByTagNameNS(MagicEnvelope::NS, 'sig')->item(0);
         return array(
-            'data' => trim($data_element->nodeValue),
+            'data' => preg_replace('/\s/', '', $data_element->nodeValue),
             'data_type' => $data_element->getAttribute('type'),
             'encoding' => $env_element->getElementsByTagNameNS(MagicEnvelope::NS, 'encoding')->item(0)->nodeValue,
             'alg' => $env_element->getElementsByTagNameNS(MagicEnvelope::NS, 'alg')->item(0)->nodeValue,
-            'sig' => $env_element->getElementsByTagNameNS(MagicEnvelope::NS, 'sig')->item(0)->nodeValue,
+            'sig' => preg_replace('/\s/', '', $sig_element->nodeValue),
         );
     }