---
title: "Top Content und doppeltes htmlspecialchars()??"
url: "https://www.typo3.net/d/88842-top-content-und-doppeltes-htmlspecialchars"
source: "typo3.net"
tags: ["Extensions","Frage"]
created: "2009-04-14"
last_reply: "2009-04-14"
replies: 3
solved: false
page: 1
pages: 1
lang: "de"
---

# Top Content und doppeltes htmlspecialchars()??

Extensions · 3 Antworten · gestartet 2009-04-14

## Eröffnungsbeitrag

**fatalerror15** · 2009-04-14 · [Beitrag #1](https://www.typo3.net/d/88842-top-content-und-doppeltes-htmlspecialchars/1)

Hallo,

ich habe das Plugin "gsttopcontent" auf unserer Seite eingefügt. Das Plugin sucht in der tt_content nach neuen Inhalten und stellt diese auf der Website dar.
Allerdings werden die HTML-Zeichen entsprechend ihren codierungen im Frontend angezeigt (also & nbsp; statt " " usw.)

Wenn ich mir den Quellcode anzeigen lasse, steht an der Stelle "& amp;nbsp;" was ja ausgeschrieben auch & nbsp; entspricht.

Ich bekomme das aber einfach nicht weg. Wie kann ich dann das abschalten??? Hat da jemand eine Idee???

PS: Ich musste zwichen dem & und dem rest der HTML-Zeichen ein Leerzeichen einfügen, damit das im Thema richtig dargestellt wird. Das ist also kein fehler...

## Antworten

### [#2](https://www.typo3.net/d/88842-top-content-und-doppeltes-htmlspecialchars/2) · kolki · 2009-04-14

Editiere die pi1/class.tx_gsttopcontent.php:

```php
				// Get teasertext of the content.
 if(strlen($row['teaserfield']) > 0) {
  $teasertext = $row['teaserfield'];
  $teasertext = str_replace("& nbsp;"," ",$teasertext);
  $teasertext = str_replace("& amp;","&",$teasertext);
  $teasertext = str_replace('& quot;','"',$teasertext);
  $teasertext = str_replace('- ','',$teasertext);
 } else {
 if($this->config['useTeaserAndBodytext']) {
  $teasertext = $row['bodytext'];
  $teasertext = str_replace("& nbsp;"," ",$teasertext);
  $teasertext = str_replace("& amp;","&",$teasertext);
  $teasertext = str_replace('& quot;','"',$teasertext);
  $teasertext = str_replace('- ;','',$teasertext);
  } // end if
 } // end if
```

Die Leerzeichen bei "& nbsp;","& amp;" und '& quot;' bitte entfernen. Die habe ich nur eingefügt, da das Script in diesem Forum sonst nicht korrekt angezeigt wird.

### [#3](https://www.typo3.net/d/88842-top-content-und-doppeltes-htmlspecialchars/3) · fatalerror15 · 2009-04-14

Vielen vielen Dank. Hat sofort funktioniert...

### [#4](https://www.typo3.net/d/88842-top-content-und-doppeltes-htmlspecialchars/4) · kolki · 2009-04-14

> **fatalerror15 schrieb:**
>
> Vielen vielen Dank. Hat sofort funktioniert...

Gern geschehen! :D

---

Quelle: „Top Content und doppeltes htmlspecialchars()??“, typo3.net, https://www.typo3.net/d/88842-top-content-und-doppeltes-htmlspecialchars
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
