From 8b4932ca8120dfb76929edf09b3bbead6d0e71c3 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Sun, 6 Apr 2014 16:35:30 -0300 Subject: [PATCH] Avoid duplicate ids There can be more then one in page. Don't reuse id attributes. See also r60072 Bug: 11777 Change-Id: If7c518445c966aa5c0b16929ccdf22cdf014b59d --- InputBox.classes.php | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/InputBox.classes.php b/InputBox.classes.php index be424ac1..22ab1852 100644 --- a/InputBox.classes.php +++ b/InputBox.classes.php @@ -91,6 +91,14 @@ class InputBox { if ( !$this->mSearchButtonLabel ) { $this->mSearchButtonLabel = wfMessage( 'inputbox-searchfulltext' )->text(); } + if ( $this->mID !== '' ) { + $idArray = array( 'id' => Sanitizer::escapeId( $this->mID ) ); + } else { + $idArray = array(); + } + // We need a unqiue id to link