openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 1f9b00f85cb21f936485b497061340924e623af5
parent 46e478ba617cae00d8733715b7904eb58372d28d
Author: dankert <devnull@localhost>
Date:   Thu, 21 Mar 2013 23:36:26 +0100

Merge vom PC.

Diffstat:
util/Transformer.class.php | 22+++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/util/Transformer.class.php b/util/Transformer.class.php @@ -72,16 +72,24 @@ class Transformer // Hack: Sonderzeichen muessen in URLs maskiert werden, aber nur bei URLs die aus Link-Objekten kommen, bei allem // anderen (insbesondere Preview-Links zu andereen Seiten) darf die Umsetzung nicht erfolgen. // Der Renderer kann dies nicht tun, denn der erzeugt nur "object://..."-URLs. - // Beispiel: "...?a=1&b=2" wird zu "...?a=1&amp;b=2" + // Beispiel: "...?a=1&b=2" wird zu "...?a=1&amp;b=2" $o = new Object($objectId); - $o->load(); - if ( $o->isLink ) + try + { + $o->load(); + if ( $o->isLink ) + { + $l = new Link($objectId); + $l->load(); + if ( $l->isLinkToUrl && $this->page->mimeType() == 'text/html' ) + $targetPath = htmlspecialchars($targetPath); + } + } + catch( ObjectNotFoundException $e) { - $l = new Link($objectId); - $l->load(); - if ( $l->isLinkToUrl && $this->page->mimeType() == 'text/html' ) - $targetPath = htmlspecialchars($targetPath); + $targetPath = 'javascript:alert("object '.$objectId.' not found");'; } + $text = str_replace( 'object:' .$objectId, $targetPath, $text ); $text = str_replace( 'object://'.$objectId, $targetPath, $text );