mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 14:00:56 +01:00
strncmp is better than strpos
Summary: no need to get all O(N) up in this when we can do constant time of "8" Test Plan: arc lint Reviewers: vrana, epriestley Reviewed By: vrana CC: aran, Korvin Maniphest Tasks: T891 Differential Revision: https://secure.phabricator.com/D3271
This commit is contained in:
parent
6ce39db6ca
commit
f748a47237
1 changed files with 1 additions and 1 deletions
|
@ -105,7 +105,7 @@ extends PhabricatorOAuthProvider {
|
|||
|
||||
public function setUserData($data) {
|
||||
// legacy conditionally strip shield. see D3265 for discussion.
|
||||
if (strpos($data, 'for(;;);') === 0) {
|
||||
if (strncmp($data, 'for(;;);', 8) === 0) {
|
||||
$data = substr($data, 8);
|
||||
}
|
||||
$data = idx(json_decode($data, true), 'result');
|
||||
|
|
Loading…
Reference in a new issue