]> git.mjollnir.org Git - moodle.git/commitdiff
cleaned up a bad copy/paste in a few if statements
authordhawes <dhawes>
Thu, 20 Jan 2005 01:01:48 +0000 (01:01 +0000)
committerdhawes <dhawes>
Thu, 20 Jan 2005 01:01:48 +0000 (01:01 +0000)
rss/rsslib.php

index 82e35ba0d4bca3e88cd06b115dddc8722f729090..15453fba9cf07a360bdd33126dfc48f77a6f11ce 100644 (file)
@@ -393,10 +393,10 @@ function rss_get_feed($rssid, $url, $type) {
                     $errorstring = $urlfailurestring .'<br /><br />'. $errorstring .'<br />';
                 }
                 $xml = load_feed_from_file($file);
-                if (!empty($xml) && !empty($xml->xml) && empty($xml->ERROR)) {
+                if (!empty($xml) && empty($xml->xml) && !empty($xml->ERROR)) {
                     // Failed to load from cache as well!
                     if ($CFG->debug) {
-                        if (isset($xml) && isset($xml->ERROR)) {
+                        if (!empty($xml) && !empty($xml->ERROR)) {
                            $errorstring = $xml->ERROR . $errorstring;
                         }
                         $errorstring = $filefailurestring . $file .'<br /><br />'. $errorstring .'<br />';
@@ -408,10 +408,10 @@ function rss_get_feed($rssid, $url, $type) {
         } else {
             // Cached file has not expired. Attempt to read from cached file.
             $xml = load_feed_from_file($file);
-            if (!empty($xml) && !empty($xml->xml) && empty($xml->ERROR)) {
+            if (!empty($xml) && empty($xml->xml) && !empty($xml->ERROR)) {
                 // Failed to load from cache, attempt to read from source
                 if ($CFG->debug) {
-                    if (isset($xml) && isset($xml->ERROR)) {
+                    if (!empty($xml) && !empty($xml->ERROR)) {
                        $errorstring = $xml->ERROR . $errorstring .'<br />';
                     }
                     $errorstring = $filefailurestring . $file .'<br /><br />'. $errorstring .'<br />';
@@ -454,7 +454,7 @@ function rss_get_feed($rssid, $url, $type) {
         }
     }
     
-    // echo 'DEBUG: feed\'s raw xml was loaded:<br />';//debug
+    // echo 'DEBUG: raw xml was loaded successfully:<br />';//debug
     //print_object($xml); //debug
     
     //implode xml file. in some cases this operation may fail, capture failure info to errorstring.