aboutsummaryrefslogtreecommitdiffstats
path: root/includes/media
diff options
context:
space:
mode:
authorMark Shenouda <mark@thisdot.co>2022-06-08 22:46:26 +0200
committerMatthias Mullie <git@mullie.eu>2022-07-05 17:09:15 +0200
commitd4e3a74e9e8042b4f7fd943dc631e483fde881de (patch)
tree0c82e469c64b5057e4bf0cd45c5e393ceb2c240a /includes/media
parent481f6637f88d06b8520eef1273ba5ba4c9921fd3 (diff)
downloadmediawikicore-d4e3a74e9e8042b4f7fd943dc631e483fde881de.tar.gz
mediawikicore-d4e3a74e9e8042b4f7fd943dc631e483fde881de.zip
FormatMetadata: PHP Notice: Array to string conversion
[x] Logging more data when it happens again Bug: T297403 Change-Id: I4bf2f4204e990b2869c497ffd3a79af7cde34434
Diffstat (limited to 'includes/media')
-rw-r--r--includes/media/FormatMetadata.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php
index 44e9f3f0337c..e2f224b1fecf 100644
--- a/includes/media/FormatMetadata.php
+++ b/includes/media/FormatMetadata.php
@@ -1168,6 +1168,12 @@ class FormatMetadata extends ContextSource {
return ""; // paranoia. This should never happen
} else {
+ // Check if $vals contains nested arrays
+ $containsNestedArrays = in_array( true, array_map( 'is_array', $vals ), true );
+ if ( $containsNestedArrays ) {
+ wfLogWarning( __METHOD__ . ': Invalid $vals, contains nested arrays: ' . json_encode( $vals ) );
+ }
+
/* @todo FIXME: This should hide some of the list entries if there are
* say more than four. Especially if a field is translated into 20
* languages, we don't want to show them all by default