Page MenuHomePhabricator

User::newFromId should not assume ID exists
Open, LowPublic

Description

In other words:

"User:newFromId should not set ItemLoaded['id'] = true"

$ php maintenance/eval.php:

< $u = User:newFromId( 1000000000000000000 ); // Exa-, 10^18
< $u->getId();
1000000000000000000;

var_dump( $u->isLoggedIn() );
true
$u->isItemLoaded( 'id' );
true

Bumped into this while fixing T42340 (bug 40340).

Details

Reference
bz40342

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:59 AM
bzimport set Reference to bz40342.

If you're going to set a milestone, it would be reasonable to set a priority.

aravikn wrote:

User.php, Line 278.

$this->mLoadedItems = true;
// Set it now to avoid infinite recursion in accessors

Isn't this the thing that was asked to be changed? But would infinite recursion occur as specified?

Krinkle raised the priority of this task from Low to Medium.Nov 24 2014, 3:22 PM
Krinkle removed a project: Future-Release.
Krinkle set Security to None.
Krinkle added a subscriber: Reedy.
Krinkle lowered the priority of this task from Medium to Low.