fix single author could generate reference problem.

This commit is contained in:
wlx 2013-11-16 07:43:30 +00:00
parent 9512051737
commit cd8fe1ca87
1 changed files with 7 additions and 1 deletions

View File

@ -277,7 +277,13 @@ class Ris
//创建reference 字段 //创建reference 字段
public function makeReferenceFlag($ref){ public function makeReferenceFlag($ref){
$str = join(', ',$ref['author']).'. '; $str='';
if(is_array($author) && count($author) > 0)
{
$str .= join(', ',$ref['author']).'. ';
} else if if(is_string($author)) {
$str .= $ref['author'].'. ';
}
$str .= $ref['title'].'. '; $str .= $ref['title'].'. ';
$str .= $ref['publisher'].', '; $str .= $ref['publisher'].', ';
isset($ref['year']) ? $str .= $ref['year'].', ':""; isset($ref['year']) ? $str .= $ref['year'].', ':"";