Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

PHP-1431: Fix database name validation to include '$external', to allow execution of user admin commands #844

Merged
merged 1 commit into from
Apr 23, 2015

Conversation

derickr
Copy link
Contributor

@derickr derickr commented Apr 22, 2015

No description provided.

/* We allow the special case "$external" as database name (PHP-1431) */
if (strcmp("$external", dbname) == 0) {
return 1;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be more concise to just move this special case above the preceding character checks. That would eliminate the diff to the character check if block and remove second conditional below (also keeping the exception for "$" characters consistent).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had it that way at first, but then decided against it. I can't remember why though... so I've changed it back.

@derickr derickr force-pushed the PHP-1431-database-external branch from 22a0ee9 to b806eb5 Compare April 23, 2015 09:11
@jmikola
Copy link
Member

jmikola commented Apr 23, 2015

LGTM.

derickr added a commit that referenced this pull request Apr 23, 2015
@derickr derickr merged commit b806eb5 into mongodb:v1.6 Apr 23, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants