From c929400a8b4f89b8fdb63decdd15e3c1c245afd9 Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Fri, 7 Mar 2014 22:56:37 +0100 Subject: [PATCH] refactors to remove duplicated and ambiguous code --- bibtexbrowser.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/bibtexbrowser.php b/bibtexbrowser.php index b8dbdeb..253fca9 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -1041,7 +1041,7 @@ class BibEntry { function setIndex($index) { $this->index = $index; } - /** Tries to build a good URL for this entry */ + /** Tries to build a good URL for this entry. The URL should be absolute (better for the generated RSS) */ function getURL() { if (defined('BIBTEXBROWSER_URL_BUILDER')) { $f = BIBTEXBROWSER_URL_BUILDER; @@ -1052,15 +1052,6 @@ class BibEntry { return BIBTEXBROWSER_URL.'?'.createQueryString(array(Q_KEY=>$this->getKey(), Q_FILE=>$this->filename)); } - /** Tries to build a good absolute URL for this entry */ - function getAbsoluteURL() { - if (defined('BIBTEXBROWSER_URL_BUILDER')) { - $f = BIBTEXBROWSER_URL_BUILDER; - return $f($this); - } - return "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']).'/'.$this->getURL(); - } - /** returns a "[pdf]" link if relevant */ function getUrlLink() { if ($this->hasField('url')) return ' [pdf]'; @@ -3547,7 +3538,7 @@ class RSSDisplay { ?> <?php echo $this->text2rss($bibentry->getTitle());?> - getAbsoluteURL();?> + getURL();?>