]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Match empty on "" and not just NULL
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 8 Mar 2016 01:00:34 +0000 (02:00 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 8 Mar 2016 01:00:34 +0000 (02:00 +0100)
scripts/upgrade.php

index d5178e109aa40026836d8c8d85b68fac4ae87833..c9fe4b081755ffd706c94259bb4fe259e2b5a436 100755 (executable)
@@ -457,7 +457,7 @@ function deleteLocalFileThumbnailsWithoutFilename()
         while ($file->fetch()) {
             $thumbs = new File_thumbnail();
             $thumbs->file_id = $file->id;
-            $thumbs->whereAdd('filename IS NULL');
+            $thumbs->whereAdd('filename IS NULL OR filename = ""');
             // Checking if there were any File_thumbnail entries without filename
             if (!$thumbs->find()) {
                 continue;
@@ -480,7 +480,7 @@ function deleteMissingLocalFileThumbnails()
     printfnq("Removing all local File_thumbnail entries without existing files...");
 
     $thumbs = new File_thumbnail();
-    $thumbs->whereAdd('filename IS NOT NULL');  // only fill in names where they're missing
+    $thumbs->whereAdd('filename IS NOT NULL AND filename != ""');
     // Checking if there were any File_thumbnail entries without filename
     if ($thumbs->find()) {
         while ($thumbs->fetch()) {