|
From: <var...@us...> - 2009-01-08 10:26:46
|
Revision: 6382
http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6382&view=rev
Author: vargenau
Date: 2009-01-08 10:26:40 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
Empty alternative if none provided
Modified Paths:
--------------
trunk/lib/InlineParser.php
trunk/lib/stdlib.php
Modified: trunk/lib/InlineParser.php
===================================================================
--- trunk/lib/InlineParser.php 2009-01-08 09:56:52 UTC (rev 6381)
+++ trunk/lib/InlineParser.php 2009-01-08 10:26:40 UTC (rev 6382)
@@ -930,7 +930,7 @@
$page = substr($match,2,-2);
if (strpos($page, "|") === false) {
$imagename = $page;
- $alt = $page;
+ $alt = "";
} else {
$imagename = substr($page, 0, strpos($page, "|"));
$alt = ltrim(strstr($page, "|"), "|");
Modified: trunk/lib/stdlib.php
===================================================================
--- trunk/lib/stdlib.php 2009-01-08 09:56:52 UTC (rev 6381)
+++ trunk/lib/stdlib.php 2009-01-08 10:26:40 UTC (rev 6382)
@@ -401,7 +401,7 @@
*
* Handle embeddable objects, like svg, class, vrml, swf, svgz, pdf, avi, wmv especially.
*/
-function LinkImage($url, $alt = false) {
+function LinkImage($url, $alt = "") {
$force_img = "png|jpg|gif|jpeg|bmp|pl|cgi";
// Disallow tags in img src urls. Typical CSS attacks.
// FIXME: Is this needed (or sufficient?)
@@ -414,9 +414,14 @@
} else {
// support new syntax: [prefix/image.jpg size=50% border=n]
//if (!preg_match("/\.(".$force_img.")/i", $url))
- if (empty($alt)) $alt = basename($url);
+ if (empty($alt)) $alt = "";
$arr = split(' ',$url);
- $link = HTML::img(array('src' => $url, 'alt' => $alt, 'title' => $alt));
+ if ($alt == "") {
+ $link = HTML::img(array('src' => $url, 'alt' => $alt));
+ } else {
+ $link = HTML::img(array('src' => $url,
+ 'alt' => $alt, 'title' => $alt));
+ }
if (count($arr) > 1) {
$url = $arr[0];
array_shift($arr);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|