[gnome-web-www] previous-donors: Check for empty files and skip them



commit 49ddeb0f469f07cbd6b90006b07f110d854e6bbe
Author: Tobias Mueller (ideabox) <tobiasmue gnome org>
Date:   Wed Apr 24 15:25:15 2013 +0200

    previous-donors: Check for empty files and skip them
    
    So we can create the files but leave them empty. This will hopefully make
    it easier for people to know which files need to be populated. It also
    reduces maintenance costs on the automatically committing side since
    empty files can be had.

 theme/page-previous-donors.php |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/theme/page-previous-donors.php b/theme/page-previous-donors.php
index 7bb9d92..512dd0e 100644
--- a/theme/page-previous-donors.php
+++ b/theme/page-previous-donors.php
@@ -24,7 +24,8 @@ foreach (array(
         $cache_name = "fog_donors_file_{$year}_{$level}";
         if (false === ($donors_file = get_transient($cache_name))) {
             $url = dirname(__FILE__) . "/fog_donors/{$year}-{$level}.txt";
-            if (false === ($donors_file = file_get_contents($url))) {
+            if (false === ($donors_file = file_get_contents($url)) ||
+                strlen($donors_file) == 0) {
                 continue;
             } else {
                 // keeps an hour cache


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]