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

rss test, a=chris

Chris Pollett [2011-09-30 01:Sep:th]
rss test, a=chris
Filename
controllers/search_controller.php
lib/index_bundle_iterators/word_iterator.php
models/model.php
diff --git a/controllers/search_controller.php b/controllers/search_controller.php
index 0a6b742bc..2ba340873 100755
--- a/controllers/search_controller.php
+++ b/controllers/search_controller.php
@@ -334,6 +334,7 @@ class SearchController extends Controller implements CrawlConstants
         }
         $data['PAGES'] = (isset($phrase_results['PAGES'])) ?
              $phrase_results['PAGES']: array();
+
         $data['TOTAL_ROWS'] = (isset($phrase_results['TOTAL_ROWS'])) ?
             $phrase_results['TOTAL_ROWS'] : 0;
         $data['LIMIT'] = $limit;
diff --git a/lib/index_bundle_iterators/word_iterator.php b/lib/index_bundle_iterators/word_iterator.php
index cf43e3b78..f363ca016 100644
--- a/lib/index_bundle_iterators/word_iterator.php
+++ b/lib/index_bundle_iterators/word_iterator.php
@@ -319,8 +319,11 @@ class WordIterator extends IndexBundleIterator
      *
      * @param int $generation generation to advance beyond
      */
-    function advanceGeneration($generation)
+    function advanceGeneration($generation = null)
     {
+        if($generation === null) {
+            $generation = $this->current_generation;
+        }
         do {
             if($this->generation_pointer < $this->num_generations) {
                 $this->generation_pointer++;
diff --git a/models/model.php b/models/model.php
index 82f5341fb..52f6df472 100755
--- a/models/model.php
+++ b/models/model.php
@@ -146,8 +146,12 @@ class Model implements CrawlConstants
                     $page[self::TITLE] = $page[self::URL];
                 }
             }
-
-
+            // do a little cleaning on text
+            $page[self::TITLE] = preg_replace('/[^(\x20-\x7F)]*/','',
+                 $page[self::TITLE]);
+            $page[self::DESCRIPTION] = preg_replace('/[^(\x20-\x7F)]*/','',
+                 $page[self::DESCRIPTION]);
+
             if($words != NULL) {
                 $page[self::TITLE] =
                     $this->boldKeywords($page[self::TITLE], $words);
ViewGit