浏览代码

Suppressed warnings due to the error reporting. When one of the arguments in the call stack is an array, a warning (Conversion of an array into a string) is issued at the time the EventIssue is being recorded. When a posted parameter is an array, the same warning is issued at the time and EventIssue is being displayed.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4608 a333f486-631f-4898-b8df-5754b55c2be0
romainq 8 年之前
父节点
当前提交
2d6cf7d946
共有 2 个文件被更改,包括 5 次插入3 次删除
  1. 3 1
      core/attributedef.class.inc.php
  2. 2 2
      core/event.class.inc.php

+ 3 - 1
core/attributedef.class.inc.php

@@ -6293,7 +6293,9 @@ class AttributeTable extends AttributeDBField
 			$sRes .= "<TR>";
 			foreach ($aRawData as $iCol => $cell)
 			{
-				$sCell = str_replace("\n", "<br>\n", Str::pure2html((string)$cell));
+				// Note: avoid the warning in case the cell is made of an array
+				$sCell = @Str::pure2html((string)$cell);
+				$sCell = str_replace("\n", "<br>\n", $sCell);
 				$sRes .= "<TD>$sCell</TD>";
 			}
 			$sRes .= "</TR>";

+ 2 - 2
core/event.class.inc.php

@@ -264,8 +264,8 @@ class EventIssue extends Event
 				}
 				else
 				{
-					// Not a string
-					$aPost[$sKey] = (string) $sValue;
+					// Not a string (avoid warnings in case the value cannot be easily casted into a string)
+					$aPost[$sKey] = @(string) $sValue;
 				}
 			}
 			$this->Set('arguments_post', $aPost);