fix a bug when splitting author list
This commit is contained in:
@@ -229,3 +229,15 @@ MRREVIEWER = {Jean-Fran{\c{c}}ois Clouet},
|
||||
author = "Foo Bar",
|
||||
year = 2017
|
||||
}
|
||||
|
||||
@techreport{arXiv-1807.05030,
|
||||
author = {Oscar Luis Vera{-}P{\'{e}}rez and
|
||||
Benjamin Danglot and
|
||||
Martin Monperrus and
|
||||
Benoit Baudry},
|
||||
title = {A Comprehensive Study of Pseudo-tested Methods},
|
||||
year = {2018},
|
||||
number = {1807.05030},
|
||||
institution = {arXiv},
|
||||
url = {http://arxiv.org/pdf/1807.05030},
|
||||
}
|
||||
|
||||
@@ -653,6 +653,7 @@ class BTBTest extends PHPUnit_Framework_TestCase {
|
||||
function test_identity() {
|
||||
$btb = new BibDataBase();
|
||||
$btb->load('bibacid-utf8.bib');
|
||||
bibtexbrowser_configure('BIBTEXBROWSER_BIBTEX_VIEW_FILTEREDOUT', '');
|
||||
|
||||
// computing the representation
|
||||
$d = new SimpleDisplay();
|
||||
@@ -663,6 +664,7 @@ class BTBTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
$nref = count($btb->bibdb);
|
||||
$bibtex = $btb->toBibtex();
|
||||
|
||||
// reparsing the new content
|
||||
$btb2 = $this->_createDB($bibtex, 'bibacid-utf8.bib');
|
||||
$d->setDB($btb2);
|
||||
@@ -750,6 +752,15 @@ class BTBTest extends PHPUnit_Framework_TestCase {
|
||||
$this->assertEquals("[1]", $db->getEntryByKey('key2')->getAbbrv());
|
||||
}
|
||||
|
||||
function test_bug_201808() {
|
||||
$btb = new BibDataBase();
|
||||
$btb->load('bibacid-utf8.bib');
|
||||
$this->assertEquals(4,count($btb->bibdb['arXiv-1807.05030']->getRawAuthors()));
|
||||
$this->assertEquals(4,count($btb->bibdb['arXiv-1807.05030']->getFormattedAuthorsArray()));
|
||||
$this->assertEquals("Oscar Luis Vera-Pérez, Benjamin Danglot, Martin Monperrus and Benoit Baudry",$btb->bibdb['arXiv-1807.05030']->getAuthor());
|
||||
}
|
||||
|
||||
|
||||
} // end class
|
||||
|
||||
@copy('bibtexbrowser.local.php.bak','bibtexbrowser.local.php');
|
||||
|
||||
+2
-2
@@ -1394,7 +1394,7 @@ class BibEntry {
|
||||
* return a string 'Unknown'. */
|
||||
function getAuthor() {
|
||||
if (array_key_exists(AUTHOR, $this->fields)) {
|
||||
return getFormattedAuthorsString();
|
||||
return $this->getFormattedAuthorsString();
|
||||
}
|
||||
// 2010-03-02: commented the following, it results in misleading author lists
|
||||
// issue found by Alan P. Sexton
|
||||
@@ -1444,7 +1444,7 @@ class BibEntry {
|
||||
}
|
||||
|
||||
function split_authors() {
|
||||
$array = preg_split('/ and /i', @$this->raw_fields[Q_AUTHOR]);
|
||||
$array = preg_split('/ and( |$)/ims', @$this->raw_fields[Q_AUTHOR]);
|
||||
$res = array();
|
||||
// we merge the remaining ones
|
||||
for ($i=0; $i < count($array)-1; $i++) {
|
||||
|
||||
Reference in New Issue
Block a user