* [misc] fix bug when building index.
This commit is contained in:
@@ -665,8 +665,8 @@ class searchModel extends model
|
||||
$index->objectType = $objectType;
|
||||
$index->objectID = $object->{$fields->id};
|
||||
$index->title = $object->{$fields->title};
|
||||
$index->addedDate = !empty($object->{$fields->addedDate}) ? $object->{$fields->addedDate} : NULL;
|
||||
$index->editedDate = !empty($object->{$fields->editedDate}) ? $object->{$fields->editedDate} : NULL;
|
||||
$index->addedDate = !empty($object->{$fields->addedDate}) ? (!helper::isZeroDate($object->{$fields->addedDate}) ? $object->{$fields->addedDate} : NULL) : NULL;
|
||||
$index->editedDate = !empty($object->{$fields->editedDate}) ? (!helper::isZeroDate($object->{$fields->editedDate}) ? $object->{$fields->editedDate} : NULL) : NULL;
|
||||
$index->vision = isset($object->vision) ? $object->vision : 'rnd';
|
||||
|
||||
$index->content = '';
|
||||
|
||||
@@ -1216,7 +1216,7 @@ class searchTao extends searchModel
|
||||
if($convertedFile) $object->comment .= substr(file_get_contents($convertedFile), 0, $this->config->search->maxFileSize);
|
||||
}
|
||||
|
||||
if($file->extension == 'txt') $object->comment .= substr(file_get_contents($file->realPath), 0, $this->config->search->maxFileSize);
|
||||
if($file->extension == 'txt' && file_exists($file->realPath)) $object->comment .= substr(file_get_contents($file->realPath), 0, $this->config->search->maxFileSize);
|
||||
}
|
||||
|
||||
$object->comment = htmlspecialchars($object->comment);
|
||||
|
||||
Reference in New Issue
Block a user