viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Fix bug in display of webp thumbs

Chris Pollett [2023-12-29 17:Dec:th]
Fix bug in display of webp thumbs
Filename
src/controllers/ResourceController.php
src/library/index_bundle_iterators/IntersectIterator.php
diff --git a/src/controllers/ResourceController.php b/src/controllers/ResourceController.php
index 29a54e1f8..fa9d1e43f 100644
--- a/src/controllers/ResourceController.php
+++ b/src/controllers/ResourceController.php
@@ -251,7 +251,7 @@ class ResourceController extends Controller implements CrawlConstants
                 if ($_REQUEST['t'] == 'athumb') {
                     $name .= ".gif";
                 } else {
-                    $name .= ".jpg";
+                    $name .= ".webp";
                 }
             }
             $sub_path = "";
diff --git a/src/library/index_bundle_iterators/IntersectIterator.php b/src/library/index_bundle_iterators/IntersectIterator.php
index 8e232a0dc..857c9eefb 100644
--- a/src/library/index_bundle_iterators/IntersectIterator.php
+++ b/src/library/index_bundle_iterators/IntersectIterator.php
@@ -160,7 +160,8 @@ class IntersectIterator extends IndexBundleIterator
             }
             $this->index_bundle_iterators[$i]->setResultsPerBlock(1);
         }
-        $this->total_num_docs = $this->num_docs;
+        $this->total_num_docs = $this->index_bundle_iterators[0]->total_num_docs
+            ?? $this->num_docs;
     }
     /**
      * Returns the iterators to the first document block that it could iterate
ViewGit