added support for using external bib files located on other servers if BIBTEXBROWSER_LOCAL_BIB_ONLY is set to false (feature suggested by Jen)

This commit is contained in:
Martin Monperrus
2011-06-13 11:20:36 +02:00
parent 9c81344ac3
commit 6799f8a61f
+5 -1
View File
@@ -262,6 +262,8 @@ define('BIBTEXBROWSER','v__MTIME__');
@define('BIBTEXBROWSER_BIB_IN_NEW_WINDOW',false); @define('BIBTEXBROWSER_BIB_IN_NEW_WINDOW',false);
@define('BIBLIOGRAPHYSTYLE','DefaultBibliographyStyle');// this is the name of a function @define('BIBLIOGRAPHYSTYLE','DefaultBibliographyStyle');// this is the name of a function
@define('BIBLIOGRAPHYSECTIONS','DefaultBibliographySections');// this is the name of a function @define('BIBLIOGRAPHYSECTIONS','DefaultBibliographySections');// this is the name of a function
// can we load bibtex files on external servers?
@define('BIBTEXBROWSER_LOCAL_BIB_ONLY', true);
@define('COMMA_NAMES',false);// do have authors in a comma separated form? @define('COMMA_NAMES',false);// do have authors in a comma separated form?
@define('TYPES_SIZE',10); // number of entry types per table @define('TYPES_SIZE',10); // number of entry types per table
@define('YEAR_SIZE',20); // number of years per table @define('YEAR_SIZE',20); // number of years per table
@@ -345,7 +347,9 @@ function setDB() {
// ---------------------------- HANDLING unexistent files // ---------------------------- HANDLING unexistent files
foreach(explode(MULTIPLE_BIB_SEPARATOR, $_GET[Q_FILE]) as $bib) { foreach(explode(MULTIPLE_BIB_SEPARATOR, $_GET[Q_FILE]) as $bib) {
if (!file_exists($bib)) {
// this is a security protection
if (BIBTEXBROWSER_LOCAL_BIB_ONLY && !file_exists($bib)) {
// 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>');