r60699 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60698‎ | r60699 | r60700 >
Date:22:59, 5 January 2010
Author:tparscal
Status:ok
Tags:
Comment:
Fixed bug that happens when the match returns null.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js
@@ -319,8 +319,10 @@
320320 var sanatizedStr = wikitext.replace( /{{/, " " );
321321 // Replace end
322322 endBraces = sanatizedStr.match( /}}\s*$/ );
323 - sanatizedStr = sanatizedStr.substring( 0, endBraces.index ) + " " +
324 - sanatizedStr.substring( endBraces.index + 2 );
 323+ if ( endBraces ) {
 324+ sanatizedStr = sanatizedStr.substring( 0, endBraces.index ) + " " +
 325+ sanatizedStr.substring( endBraces.index + 2 );
 326+ }
325327 // Match the open braces we just found with equivalent closing braces note, works for any level of braces
326328 while ( sanatizedStr.indexOf( '{{' ) != -1 ) {
327329 startIndex = sanatizedStr.indexOf( '{{' ) + 1;

Follow-up revisions

RevisionCommit summaryAuthorDate
r60700Bumped and rebuilt for r60699.tparscal23:00, 5 January 2010

Status & tagging log