WordPress.org

Making WordPress.org

Changeset 1993


Ignore:
Timestamp:
10/18/2015 07:33:30 PM (4 years ago)
Author:
ocean90
Message:

Trac: Don't link reserved names.

Props DrewAPicture.
Fixes #1344.
See #830.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js

    r1990 r1993  
    4141    gardenerKeywordList = [ 'commit', 'early', 'i18n-change', 'good-first-bug' ];
    4242
     43    reservedTerms = [
     44        'access', 'deprecated', 'global', 'ignore', 'internal', 'link', 'method',
     45        'package', 'return','see', 'since', 'subpackage', 'todo', 'type', 'var'
     46    ];
     47
    4348    wpTrac = {
    4449
     
    9398                if ( mentionsRegEx.test( $comment ) ) {
    9499                    $comment = $comment.replace( mentionsRegEx, function( match, username ) {
     100                        if ( -1 !== $.inArray( username, reservedTerms ) ) {
     101                            return match;
     102                        }
     103
    95104                        var meClass = ( username === wpTrac.currentUser ) ? ' me' : '';
    96105                        return ' <a class="mention' + meClass + '" href="https://profiles.wordpress.org/' + username + '">@' + username + '</a>';
Note: See TracChangeset for help on using the changeset viewer.