|
From: <var...@us...> - 2021-06-24 17:13:14
|
Revision: 10324
http://sourceforge.net/p/phpwiki/code/10324
Author: vargenau
Date: 2021-06-24 17:13:14 +0000 (Thu, 24 Jun 2021)
Log Message:
-----------
WikicreoleTable.php and RichTable.php: check line lenght
Modified Paths:
--------------
trunk/lib/plugin/RichTable.php
trunk/lib/plugin/WikicreoleTable.php
Modified: trunk/lib/plugin/RichTable.php
===================================================================
--- trunk/lib/plugin/RichTable.php 2021-06-24 12:48:16 UTC (rev 10323)
+++ trunk/lib/plugin/RichTable.php 2021-06-24 17:13:14 UTC (rev 10324)
@@ -111,18 +111,20 @@
$row->pushContent($cell);
}
$cell = HTML::td();
- $line = substr($line, 1);
- if ($line[0] == "*") {
- $attrs = parse_attributes(substr($line, 1));
- foreach ($attrs as $key => $value) {
- if (in_array($key, array("id", "class", "title", "style",
- "colspan", "rowspan", "width", "height",
- "bgcolor", "align", "valign"))
- ) {
- $cell->setAttr($key, $value);
+ if (strlen($line) > 1) {
+ $line = substr($line, 1);
+ if ($line[0] == "*") {
+ $attrs = parse_attributes(substr($line, 1));
+ foreach ($attrs as $key => $value) {
+ if (in_array($key, array("id", "class", "title", "style",
+ "colspan", "rowspan", "width", "height",
+ "bgcolor", "align", "valign"))
+ ) {
+ $cell->setAttr($key, $value);
+ }
}
+ continue;
}
- continue;
}
}
if (isset($row) and isset($cell)) {
Modified: trunk/lib/plugin/WikicreoleTable.php
===================================================================
--- trunk/lib/plugin/WikicreoleTable.php 2021-06-24 12:48:16 UTC (rev 10323)
+++ trunk/lib/plugin/WikicreoleTable.php 2021-06-24 17:13:14 UTC (rev 10324)
@@ -91,7 +91,7 @@
if ($line[strlen($line) - 1] == '|') {
$line = substr($line, 0, -1);
}
- if ($line[0] == '|') {
+ if ((strlen($line) > 0) && ($line[0] == '|')) {
$table[] = $this->parse_row($line);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|