Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
Add support for multi level wildcards
Browse files Browse the repository at this point in the history
  • Loading branch information
marcqualie committed Aug 25, 2013
1 parent 47df6cc commit 06021e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/MongoMinify/Collection.php
Expand Up @@ -235,7 +235,7 @@ private function setSchemaArray(array $array, $namespace = null)
public function getShort($full)
{
if (strpos($full, '*') !== false) {
return $this->schema_index[str_replace('.*', '', $full)] . '.*';
return $this->schema_index[substr($full, 0, -2)] . '.*';
}
if (isset($this->schema[$full]['short'])) {
return $this->schema[$full]['short'];
Expand Down
6 changes: 4 additions & 2 deletions tests/MongoMinify/Schema/mongominify.test.json
Expand Up @@ -102,8 +102,10 @@
"short": "p",
"subset": {
"*": {
"link": {
"short": "l"
"subset": {
"link": {
"short": "l"
}
}
}
}
Expand Down

0 comments on commit 06021e2

Please sign in to comment.