From d6e0700503680cf7330d180b5ec42c964b1e061d Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Fri, 1 Apr 2016 00:29:25 +0200 Subject: [PATCH] refactoring --- bibtexbrowser.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bibtexbrowser.php b/bibtexbrowser.php index 6ce13f2..25b6df9 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -1490,6 +1490,11 @@ class BibEntry { return $this->getField('year'); } + /** returns the array of keywords */ + function getKeywords() { + return preg_split('/[,;\\/]/', $bib->getField("keywords")); + } + /** Returns the value of the given field? */ function getField($name) { // 2010-06-07: profiling showed that this is very costly @@ -3589,7 +3594,7 @@ class BibDataBase { $result = array(); foreach ($this->bibdb as $bib) { if (!$bib->hasField("keywords")) continue; - $tags =preg_split('/[,;\\/]/', $bib->getField("keywords")); + $tags = $bib->getKeywords(); foreach($tags as $a){ $ta = trim($a); $result[$ta] = $ta;