From: Jens Frank Date: Sun, 30 May 2004 11:44:13 +0000 (+0000) Subject: HOTFIX, if page contains invalid links, return empty string instead of failing X-Git-Tag: 1.5.0alpha1~3136 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=7f31c32188cd1aed5b13ab513e32618c0e862549;p=lhc%2Fweb%2Fwiklou.git HOTFIX, if page contains invalid links, return empty string instead of failing --- diff --git a/includes/Skin.php b/includes/Skin.php index ca7aed5a0f..fcee456081 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1908,14 +1908,20 @@ class Skin { function makeMediaLinkObj( $nt, $alt = "" ) { - $name = $nt->getDBKey(); - $url = Image::wfImageUrl( $name ); - if ( empty( $alt ) ) { - $alt = preg_replace( '/\.(.+?)^/', '', $name ); + if ( ! defined( $nt ) ) + { + ### HOTFIX. Instead of breaking, return empry string. + $s = $alt; + } else { + $name = $nt->getDBKey(); + $url = Image::wfImageUrl( $name ); + if ( empty( $alt ) ) { + $alt = preg_replace( '/\.(.+?)^/', '', $name ); + } + + $u = htmlspecialchars( $url ); + $s = "{$alt}"; } - - $u = htmlspecialchars( $url ); - $s = "{$alt}"; return $s; }