@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix JavaScript exception when having users with special names

Summary:
The issue was noticed in Firefox when user with login "watch"
was registered in the database. And it was caused by Object
in Firefox having "watch" method.

Solved by checking for whether lookup object does have own
property before using it as a map key.

Test Plan:
To test the issue simply create a user with login "watch",
open the phabricator site in Firefox and try to assign any
maniphest task to this user. You'll see exception being
printed to the javascript console (in my case it's printed
to firebug console).

Reviewers: #blessed_reviewers, epriestley

Reviewed By: epriestley

CC: epriestley, aran

Differential Revision: https://secure.phabricator.com/D8037

authored by

Sergey Sharybin and committed by
epriestley
83ab275b 5968ed8f

+3 -1
+3 -1
webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js
··· 185 185 this._raw[obj.id] = obj; 186 186 var t = this.tokenize(obj.tokenizable || obj.name); 187 187 for (var jj = 0; jj < t.length; ++jj) { 188 - this._lookup[t[jj]] = this._lookup[t[jj]] || []; 188 + if (!this._lookup.hasOwnProperty(t[jj])) { 189 + this._lookup[t[jj]] = []; 190 + } 189 191 this._lookup[t[jj]].push(obj.id); 190 192 } 191 193 },