refactored toEntryUnformatted:\n * changed from echo to return\n * bulletproof HTML content ('<' -> '<')
This commit is contained in:
+6
-4
@@ -1292,16 +1292,18 @@ class BibEntry {
|
|||||||
* URLs are replaced by HTML links.
|
* URLs are replaced by HTML links.
|
||||||
*/
|
*/
|
||||||
function toEntryUnformatted() {
|
function toEntryUnformatted() {
|
||||||
echo '<pre class="purebibtex">'; // pre is nice when it is embedded with no CSS available
|
$result = "";
|
||||||
$entry = $this->getFullText();
|
$result .= '<pre class="purebibtex">'; // pre is nice when it is embedded with no CSS available
|
||||||
|
$entry = str_replace('<','<',$this->getFullText());
|
||||||
if ($this->hasField('url')) {
|
if ($this->hasField('url')) {
|
||||||
$url = $this->getField('url');
|
$url = $this->getField('url');
|
||||||
// this is not a parsing but a simple replacement
|
// this is not a parsing but a simple replacement
|
||||||
$entry = str_replace($url,'<a href="'.$url.'">'.$url.'</a>', $entry);
|
$entry = str_replace($url,'<a href="'.$url.'">'.$url.'</a>', $entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $entry;
|
$result .= $entry;
|
||||||
echo '</pre>';
|
$result .= '</pre>';
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user