openrat-cms

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

commit 80ee84bb19c7599e920733ca8d0bf0c799f87994
parent d1a1db792a3d2aa0b690f8340e4754adf695a025
Author: Jan Dankert <devnull@localhost>
Date:   Thu, 21 Mar 2013 22:56:08 +0100

ObjectNotFoundException fangen.

Diffstat:
Mutil/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 );