From: <var...@us...> - 2011-06-08 07:46:39
|
Revision: 8095 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8095&view=rev Author: vargenau Date: 2011-06-08 07:46:33 +0000 (Wed, 08 Jun 2011) Log Message: ----------- allow "center" as synonym for "middle"; better error message Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-06-07 14:27:18 UTC (rev 8094) +++ trunk/lib/stdlib.php 2011-06-08 07:46:33 UTC (rev 8095) @@ -159,7 +159,7 @@ function getCookieName() { return preg_replace("/[^\d\w]/", "_", WIKI_NAME) . "_WIKI_ID"; } - + /** * Generates a valid URL for a given Wiki pagename. * @param mixed $pagename If a string this will be the name of the Wiki page to link to. @@ -441,12 +441,17 @@ $link->setAttr($attr, $value); } // align = bottom|middle|top|left|right + // we allow "center" as synonym for "middle" elseif (($attr == "align") && (($value == "bottom") || ($value == "middle") + || ($value == "center") || ($value == "top") || ($value == "left") || ($value == "right"))) { + if ($value == "center") { + $value = "middle"; + } $link->setAttr($attr, $value); } // These attributes take a number (pixels): border, hspace, vspace @@ -471,9 +476,10 @@ } } else { + $url = substr(strrchr($url, "/"), 1); $link = HTML::span(array('class' => 'error'), - sprintf(_("Invalid image attribute \"%s\" %s=%s"), - $url, $attr, $value)); + sprintf(_("Invalid attribute %s=%s for image %s"), + $attr, $value, $url)); return $link; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |