diff options
author | Adrian Lang <lang@cosmocode.de> | 2009-11-04 11:01:15 +0100 |
---|---|---|
committer | Adrian Lang <lang@cosmocode.de> | 2009-11-04 11:01:15 +0100 |
commit | c66972f2cb89e65a8bbf8e39d42e8e479f7eb8dc (patch) | |
tree | 3d20030c333e987b42ff101ec339f2120f9f5883 /inc/indexer.php | |
parent | 1378fb56f6873b93fe002e8aed001e92857b5b5c (diff) | |
download | rpg-c66972f2cb89e65a8bbf8e39d42e8e479f7eb8dc.tar.gz rpg-c66972f2cb89e65a8bbf8e39d42e8e479f7eb8dc.tar.bz2 |
Emit less E_NOTICEs and E_STRICTs
Changes of behaviour are:
* Allow the user name, title & description \e2\80\9c0\e2\80\9d
* Default to Port 443 if using HTTPS
* Set $INFO['isadmin'] and $INFO['ismanager'] to \e2\80\9cfalse\e2\80\9d even if no user is
logged in
* Do not pass empty fragment field in the event data for event
ACTION_SHOW_REDIRECT
* Handle chunked encoding in HTTPClient
darcs-hash:20091104100115-e4919-5cf6397d4a457e3f98a8ca49fbdab03f2147721d.gz
Diffstat (limited to 'inc/indexer.php')
-rw-r--r-- | inc/indexer.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/inc/indexer.php b/inc/indexer.php index 1f2ff89e3..14af579bb 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -74,7 +74,7 @@ function idx_saveIndex($pre, $wlen, &$idx){ fwrite($fh,$line); } fclose($fh); - if($conf['fperm']) chmod($fn.'.tmp', $conf['fperm']); + if(isset($conf['fperm'])) chmod($fn.'.tmp', $conf['fperm']); io_rename($fn.'.tmp', $fn.'.idx'); return true; } @@ -574,12 +574,16 @@ function idx_lookup($words){ // merge found pages into final result array $final = array(); - foreach(array_keys($result) as $word){ + foreach($result as $word => $res){ $final[$word] = array(); - foreach($result[$word] as $wid){ + foreach($res as $wid){ $hits = &$docs[$wid]; foreach ($hits as $hitkey => $hitcnt) { - $final[$word][$hitkey] = $hitcnt + $final[$word][$hitkey]; + if (!isset($final[$word][$hitkey])) { + $final[$word][$hitkey] = $hitcnt; + } else { + $final[$word][$hitkey] += $hitcnt; + } } } } |