Merge pull request #10 from arnehaber/master
Bugfix issue #8, introduces issue #9
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
/.project
|
||||||
+18
-7
@@ -86,6 +86,12 @@ function bibtexbrowser_configure($key, $value) {
|
|||||||
// do we add [bibtex] links ?
|
// do we add [bibtex] links ?
|
||||||
// suggested by Sascha Schnepp
|
// suggested by Sascha Schnepp
|
||||||
@define('BIBTEXBROWSER_BIBTEX_LINKS',true);
|
@define('BIBTEXBROWSER_BIBTEX_LINKS',true);
|
||||||
|
// do we add [pdf] links ?
|
||||||
|
@define('BIBTEXBROWSER_PDF_LINKS',true);
|
||||||
|
// do we add [doi] links ?
|
||||||
|
@define('BIBTEXBROWSER_DOI_LINKS',true);
|
||||||
|
// do we add [gsid] links (Google Scholar)?
|
||||||
|
@define('BIBTEXBROWSER_GSID_LINKS',true);
|
||||||
|
|
||||||
// should authors be linked to [none/homepage/resultpage]
|
// should authors be linked to [none/homepage/resultpage]
|
||||||
// none: nothing
|
// none: nothing
|
||||||
@@ -227,8 +233,11 @@ function _zetDB($bibtex_filenames) {
|
|||||||
// ---------------------------- HANDLING unexistent files
|
// ---------------------------- HANDLING unexistent files
|
||||||
foreach(explode(MULTIPLE_BIB_SEPARATOR, $bibtex_filenames) as $bib) {
|
foreach(explode(MULTIPLE_BIB_SEPARATOR, $bibtex_filenames) as $bib) {
|
||||||
|
|
||||||
|
// get file extension to only allow .bib files
|
||||||
|
$ext = pathinfo($bib, PATHINFO_EXTENSION);
|
||||||
// this is a security protection
|
// this is a security protection
|
||||||
if (BIBTEXBROWSER_LOCAL_BIB_ONLY && !file_exists($bib)) {
|
if (BIBTEXBROWSER_LOCAL_BIB_ONLY && (!file_exists($bib) || strcasecmp($ext, 'bib') != 0)) {
|
||||||
|
|
||||||
// to automate dectection of faulty links with tools such as webcheck
|
// to automate dectection of faulty links with tools such as webcheck
|
||||||
header('HTTP/1.1 404 Not found');
|
header('HTTP/1.1 404 Not found');
|
||||||
die('<b>the bib file '.$bib.' does not exist !</b>');
|
die('<b>the bib file '.$bib.' does not exist !</b>');
|
||||||
@@ -1479,15 +1488,17 @@ class BibEntry {
|
|||||||
$str .= " <a".(BIBTEXBROWSER_BIB_IN_NEW_WINDOW?' target="_blank" ':'')." class=\"biburl\" title=\"".$this->getKey()."\" {$href}>[bibtex]</a>";
|
$str .= " <a".(BIBTEXBROWSER_BIB_IN_NEW_WINDOW?' target="_blank" ':'')." class=\"biburl\" title=\"".$this->getKey()."\" {$href}>[bibtex]</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns an empty string if no url present
|
if (BIBTEXBROWSER_PDF_LINKS) {
|
||||||
$str .= $this->getUrlLink();
|
// returns an empty string if no url present
|
||||||
|
$str .= $this->getUrlLink();
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->hasField('doi')) {
|
if (BIBTEXBROWSER_DOI_LINKS && $this->hasField('doi')) {
|
||||||
$str .= ' <a href="http://dx.doi.org/'.$this->getField("doi").'">[doi]</a>';
|
$str .= ' <a href="http://dx.doi.org/'.$this->getField("doi").'">[doi]</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Google Scholar ID
|
// Google Scholar ID
|
||||||
if ($this->hasField('gsid')) {
|
if (BIBTEXBROWSER_GSID_LINKS && $this->hasField('gsid')) {
|
||||||
$str .= ' <a href="http://scholar.google.com/scholar?cites='.$this->getField("gsid").'">[cites]</a>';
|
$str .= ' <a href="http://scholar.google.com/scholar?cites='.$this->getField("gsid").'">[cites]</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3413,8 +3424,8 @@ class RSSDisplay {
|
|||||||
// first strip HTML tags
|
// first strip HTML tags
|
||||||
$desc = strip_tags($desc);
|
$desc = strip_tags($desc);
|
||||||
|
|
||||||
// then decode characters encoded by latex2html
|
// then decode characters encoded by latex2html, preserve ENCODING
|
||||||
$desc= html_entity_decode($desc);
|
$desc = html_entity_decode($desc, ENT_COMPAT, ENCODING);
|
||||||
|
|
||||||
// some entities may still be here, we remove them
|
// some entities may still be here, we remove them
|
||||||
// we replace html entities e.g. é by nothing
|
// we replace html entities e.g. é by nothing
|
||||||
|
|||||||
Reference in New Issue
Block a user