]> source.dussan.org Git - nextcloud-server.git/commitdiff
use simplexml instead of dom for OC_APP::getAppInfo()
authorRobin Appelman <icewind1991@gmail.com>
Mon, 16 May 2011 14:20:56 +0000 (16:20 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Mon, 16 May 2011 14:20:56 +0000 (16:20 +0200)
lib/app.php

index e2744f51794938e833db8784b8ec515c423ba446..83c80f6356ebe1975fcabf80e82ba5c1001b349a 100644 (file)
@@ -326,17 +326,12 @@ class OC_APP{
                        return array();
                }
                $data=array();
-               $plugin=new DOMDocument();
-               $plugin->load($file);
-               $info=$plugin->getElementsByTagName('info');
-               if($info->length > 0){
-                       $info=$info->item(0);
-                       $data['info']=array();
-                       foreach($info->childNodes as $child){
-                               if($child->nodeType==XML_ELEMENT_NODE){
-                                       $data[$child->tagName]=$child->textContent;
-                               }
-                       }
+               $content=file_get_contents($file);
+               $xml = new SimpleXMLElement($content);
+               $info=$xml->info[0];
+               $data['info']=array();
+               foreach($info->children() as $child){
+                       $data[$child->getName()]=(string)$child;
                }
                return $data;
        }