Author: chabotc
Date: Sat Jul 19 15:01:05 2008
New Revision: 678230

URL: http://svn.apache.org/viewvc?rev=678230&view=rev
Log:
Catch message bundle errors

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

Modified: incubator/shindig/trunk/php/src/gadgets/MessageBundleParser.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/MessageBundleParser.php?rev=678230&r1=678229&r2=678230&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/MessageBundleParser.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/MessageBundleParser.php Sat Jul 19 
15:01:05 2008
@@ -30,7 +30,10 @@
 
        public function parse($xml)
        {
-               $doc = simplexml_load_string($xml);
+               $doc = @simplexml_load_string($xml);
+               if (!$doc) {
+                       throw new Exception("Invalid XML structure in message 
bundle");
+               }
                $messages = array();
                if (isset($doc->msg)) {
                        foreach ($doc->msg as $msg) {


Reply via email to