From d5e00ce01013a7993b24aa4d0ab9e3ba75ae10ef Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Sun, 19 Jan 2025 11:48:20 +0100 Subject: [PATCH] remove warning and refresh tests --- BibtexbrowserTest.php | 16 ++++------------ bibtexbrowser.php | 4 +++- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/BibtexbrowserTest.php b/BibtexbrowserTest.php index 6f7d6ec..9b7a195 100755 --- a/BibtexbrowserTest.php +++ b/BibtexbrowserTest.php @@ -62,19 +62,11 @@ class SimpleDisplayExt extends SimpleDisplay { class BibtexbrowserTest extends PHPUnit_Framework_TestCase { - public function setUp():void - { + public function setUp():void { // resetting the default link style bibtexbrowser_configure('BIBTEXBROWSER_LINK_STYLE','bib2links_default'); bibtexbrowser_configure('ABBRV_TYPE','index'); bibtexbrowser_configure('BIBTEXBROWSER_USE_PROGRESSIVE_ENHANCEMENT', false); - } - - function test_checkdoc() { - if(!is_file('gakowiki-syntax.php')) { return; } - if (!function_exists('gk_wiki2html')) { include('gakowiki-syntax.php'); } - $result = create_wiki_parser()->parse(file_get_contents('README.wiki')); - $this->assertEquals(1, strpos($result,"bibtexbrowser is a PHP script that creates publication lists from Bibtex files")); } function createDB() { @@ -99,7 +91,7 @@ class BibtexbrowserTest extends PHPUnit_Framework_TestCase { // default style $this->assertEquals("A Book (Martin Monperrus), Springer, 2009. [bibtex]",strip_tags($first_entry->toHTML())); - $this->assertEquals('A Book (), Springer, . [bibtex]',$first_entry->toHTML()); + $this->assertEquals('A Book (), Springer, . [bibtex]',$first_entry->toHTML()); // IEEE style bibtexbrowser_configure('BIBLIOGRAPHYSTYLE','JanosBibliographyStyle'); @@ -135,7 +127,7 @@ class BibtexbrowserTest extends PHPUnit_Framework_TestCase { bibtexbrowser_configure('BIBLIOGRAPHYSTYLE','DefaultBibliographyStyle'); bibtexbrowser_configure('BIBTEXBROWSER_LINK_STYLE','nothing'); $this->assertEquals("An Article (Foo Bar and Jane Doe), In New Results, volume 5, 2009. ",strip_tags($first_entry->toHTML())); - $this->assertEquals('An Article ( and ), In New Results, volume 5, . ',$first_entry->toHTML()); + $this->assertEquals('An Article ( and ), In New Results, volume 5, . ',$first_entry->toHTML()); // listing the CSS classes $css_classes_before = $this->extract_css_classes($first_entry->toHTML()); @@ -154,7 +146,7 @@ class BibtexbrowserTest extends PHPUnit_Framework_TestCase { // changing the target bibtexbrowser_configure('BIBLIOGRAPHYSTYLE','DefaultBibliographyStyle'); bibtexbrowser_configure('BIBTEXBROWSER_LINKS_TARGET','_top'); - $this->assertEquals('An Article ( and ), In New Results, volume 5, . ',$first_entry->toHTML()); + $this->assertEquals('An Article ( and ), In New Results, volume 5, . ',$first_entry->toHTML()); // testing ABBRV_TYPE bibtexbrowser_configure('ABBRV_TYPE','year'); diff --git a/bibtexbrowser.php b/bibtexbrowser.php index 5b2873d..ba5796c 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -1955,7 +1955,9 @@ class BibEntry { // referrer, the id of a collection of objects // see also http://www.openurl.info/registry/docs/pdf/info-sid.pdf - $url_parts[]='rfr_id='.s3988('info:sid/'.@$_SERVER['HTTP_HOST'].':'.basename(@$_GET[Q_FILE])); + if (@$_GET[Q_FILE] != null ) { + $url_parts[]='rfr_id='.s3988('info:sid/'.@$_SERVER['HTTP_HOST'].':'.basename(@$_GET[Q_FILE])); + } $url_parts[]='rft.date='.s3988($this->getYear());