From: <var...@us...> - 2010-11-02 17:04:21
|
Revision: 7721 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7721&view=rev Author: vargenau Date: 2010-11-02 17:04:15 +0000 (Tue, 02 Nov 2010) Log Message: ----------- If user put and extra "|-" without cells just before "|}", we ignore it to get valid XHTML code Modified Paths: -------------- trunk/lib/plugin/MediawikiTable.php Modified: trunk/lib/plugin/MediawikiTable.php =================================================================== --- trunk/lib/plugin/MediawikiTable.php 2010-10-22 18:38:33 UTC (rev 7720) +++ trunk/lib/plugin/MediawikiTable.php 2010-11-02 17:04:15 UTC (rev 7721) @@ -3,7 +3,7 @@ /* * Copyright (C) 2003 Sameer D. Sahasrabuddhe * Copyright (C) 2005 $ThePhpWikiProgrammingTeam - * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent + * Copyright (C) 2008-2010 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. * @@ -245,10 +245,20 @@ } $row->pushContent($cell); } - $tbody->pushContent($row); - $table->pushContent($tbody); + // If user put and extra "|-" without cells just before "|}" + // we ignore it to get valid XHTML code + if (!empty($row->_content)) { + $tbody->pushContent($row); + } + if (isset($tbody) && !empty($tbody->_content)) { + $table->pushContent($tbody); + } } - return $table; + if (isset($table) && !empty($table->_content)) { + return $table; + } else { + return HTML::raw(''); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |