summaryrefslogtreecommitdiff
path: root/tohtml.inc.php
diff options
context:
space:
mode:
authorDamien Regad <dregad@mantisbt.org>2022-07-22 17:07:06 +0200
committerDamien Regad <dregad@mantisbt.org>2022-07-22 17:07:06 +0200
commitbda6e1ea4271d0818dc22213e6a37269eea427b4 (patch)
treefd1962bab47e74e6b785afb0d2149cb8ea582bcf /tohtml.inc.php
parent906e84260552b014a14e8f4667335f7d8ae896e4 (diff)
downloadadodb-bda6e1ea4271d0818dc22213e6a37269eea427b4.tar.gz
adodb-bda6e1ea4271d0818dc22213e6a37269eea427b4.tar.bz2
adodb-bda6e1ea4271d0818dc22213e6a37269eea427b4.zip
Fix PHP 8.1 deprecated warning in tohtml.inc.php
Calling rs2html() with a recordset containing a NULL value results in a deprecated warning on PHP 8.1. Fixes #850
Diffstat (limited to 'tohtml.inc.php')
-rw-r--r--tohtml.inc.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/tohtml.inc.php b/tohtml.inc.php
index e92c8b44..b3c08e32 100644
--- a/tohtml.inc.php
+++ b/tohtml.inc.php
@@ -139,11 +139,14 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
*/
default:
- if ($htmlspecialchars) $v = htmlspecialchars(trim($v));
- $v = trim($v);
- if (strlen($v) == 0) $v = '&nbsp;';
- $s .= " <TD>". str_replace("\n",'<br>',stripslashes($v)) ."</TD>\n";
-
+ if ($v) {
+ $v = htmlspecialchars(stripslashes(trim($v)));
+ } elseif ($v === null) {
+ $v = '(NULL)';
+ } else {
+ $v = '&nbsp;';
+ }
+ $s .= " <TD>" . str_replace("\n", '<br>', $v) . "</TD>\n";
}
} // for
$s .= "</TR>\n\n";