added support for angstrom and protection against magic_quotes_runtime (feedback from Alexander Refsum Jensenius)
This commit is contained in:
+15
-1
@@ -378,12 +378,21 @@ define('BIBTEXBROWSER','v__MTIME__');
|
||||
|
||||
@error_reporting(/*pp4php:serl*/E_ALL/*lres*/);
|
||||
|
||||
|
||||
/** sets the database of bibtex entries (object of type BibDataBase)
|
||||
* in $_GET[Q_DB]
|
||||
* Uses a caching mechanism on disk for sake of performance
|
||||
*/
|
||||
function setDB() {
|
||||
|
||||
// Check if magic_quotes_runtime is active
|
||||
if(get_magic_quotes_runtime())
|
||||
{
|
||||
// Deactivate
|
||||
// otherwise it does not work
|
||||
set_magic_quotes_runtime(false);
|
||||
}
|
||||
|
||||
// default bib file, if no file is specified in the query string.
|
||||
if (!isset($_GET[Q_FILE]) || $_GET[Q_FILE] == "") {
|
||||
?>
|
||||
@@ -891,6 +900,10 @@ function latex2html($line) {
|
||||
// added && strpos($line,'{')===false
|
||||
if (strpos($line,'\\')===false && strpos($line,'{')===false) return $line;
|
||||
|
||||
// we should better replace this before the others
|
||||
// in order not to mix with the HTML entities coming after (just in case)
|
||||
$line = str_replace('\\&','&', $line);
|
||||
|
||||
// handling \url{....}
|
||||
// often used in howpublished for @misc
|
||||
$line = preg_replace('/\\\\url\{(.*)\}/U','<a href="\\1">\\1</a>', $line);
|
||||
@@ -942,7 +955,8 @@ function latex2html($line) {
|
||||
|
||||
$line = str_replace('\\o','ø', $line);
|
||||
$line = str_replace('\\O','Ø', $line);
|
||||
$line = str_replace('\\&','&', $line);
|
||||
$line = str_replace('\\aa','å', $line);
|
||||
$line = str_replace('\\AA','Å', $line);
|
||||
|
||||
// clean out extra tex curly brackets, usually used for preserving capitals
|
||||
$line = str_replace('}','', $line);
|
||||
|
||||
Reference in New Issue
Block a user