From 5d2cb774579b40b300b6dfd336e5d4d7f5e58e49 Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Thu, 3 Oct 2013 22:32:29 +0200 Subject: [PATCH] fixed bug when slashes are used in bibtex keys --- bibtexbrowser.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bibtexbrowser.php b/bibtexbrowser.php index 90e4d62..a81d074 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -66,7 +66,7 @@ function bibtexbrowser_configure($key, $value) { // Wrapper to use when we are included by another script @define('BIBTEXBROWSER_EMBEDDED_WRAPPER', 'NoWrapper'); -// Wrapper to use when we are included by another script +// Main class to use @define('BIBTEXBROWSER_MAIN', 'Dispatcher'); // default order functions @@ -986,7 +986,9 @@ class BibEntry { /** Sets the key of this bib entry. */ function setKey($value) { - $this->setField(Q_KEY,$value); + // Slashes are not allowed in keys because they don't play well with web servers + // if url-rewriting is used + $this->setField(Q_KEY,str_replace('/','-',$value)); } /** Sets a field of this bib entry. */ @@ -1384,6 +1386,7 @@ class BibEntry { echo ''."\n"; break; } + return $result; }