diff --git a/classes/export/bibtex.php b/classes/export/bibtex.php index d1d6940..9f90443 100644 --- a/classes/export/bibtex.php +++ b/classes/export/bibtex.php @@ -184,7 +184,7 @@ public function format(array $items, bool $abstracts = false): string { continue; } - $output .= $this->prettyTag('url') . '{' . trim($url) . '},' . PHP_EOL; + $output .= $this->prettyTag('url') . '{' . trim(str_replace("_", "\\_", $url)) . '},' . PHP_EOL; } } @@ -193,7 +193,7 @@ public function format(array $items, bool $abstracts = false): string { for ($i = 0; $i < count($item[ItemMeta::COLUMN['UIDS']]); $i++) { - $output .= $this->prettyTag(strtolower($item[ItemMeta::COLUMN['UID_TYPES']][$i])) . '{' . $item[ItemMeta::COLUMN['UIDS']][$i] . '},' . PHP_EOL; + $output .= $this->prettyTag(strtolower($item[ItemMeta::COLUMN['UID_TYPES']][$i])) . '{' . str_replace("_", "\\_", $item[ItemMeta::COLUMN['UIDS']][$i]) . '},' . PHP_EOL; } }