Skip to content

Instantly share code, notes, and snippets.

@he7d3r
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save he7d3r/0373ff0b160d8a7da7b5 to your computer and use it in GitHub Desktop.
Save he7d3r/0373ff0b160d8a7da7b5 to your computer and use it in GitHub Desktop.
Update Bugzilla links in the current page to point to the corresponding Phabricator tasks
// Copyright © 2014 He7d3r
// License: http://he7d3r.mit-license.org/
var i, link, href, match,
links = document.getElementsByTagName( 'a' );
for( i = 0; i < links.length; i++ ){
link = links[i];
href = link.href || '';
match = href.match( /^(?:(?:https?:)?\/\/(?:old-)?bugzilla\.wikimedia\.org\/)?show_bug\.cgi\?id=(\d+)$/ );
if( match ) {
link.href = 'https://phabricator.wikimedia.org/T' + ( parseInt( match[1], 10 ) + 2000 );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment