(bug 41292) Fix "containing..." search option
authorKevin Israel <pleasestand@live.com>
Tue, 23 Oct 2012 03:30:24 +0000 (23:30 -0400)
committerKevin Israel <pleasestand@live.com>
Tue, 23 Oct 2012 04:15:49 +0000 (00:15 -0400)
Line 132 of jquery.js checks '<input type="hidden"/>' against
rsingleTag. The 'type="hidden"' part causes the HTML to no longer match
the regex, so jQuery fails to add the braced attributes. The "val: '1'"
part was likely wrong anyway; the correct attribute name is "value".

The bug causes the absence of the fulltext=1 query string argument,
which leaves the title near-match logic enabled even when the user
tries to override it. This commit fixes the problem by just putting all
the attributes inside the HTML string.

Change-Id: Ibcc56f64967e55740c10fdca30c525d4afc8fb25

resources/mediawiki/mediawiki.searchSuggest.js

index ca719ab..8bcece1 100644 (file)
                                },
                                select: function ( $input ) {
                                        $input.closest( 'form' ).append(
-                                               $( '<input type="hidden"/>', {
-                                                       name: 'fulltext',
-                                                       val: '1'
-                                               })
+                                               $( '<input type="hidden" name="fulltext" value="1"/>' )
                                        );
                                        $input.closest( 'form' ).submit();
                                }
 
        } );
 
-}( mediaWiki, jQuery ) );
\ No newline at end of file
+}( mediaWiki, jQuery ) );