Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/25'
Browse files Browse the repository at this point in the history
Close #25
Close #22
  • Loading branch information
weierophinney committed Oct 17, 2016
2 parents e5922a5 + 4b4e39b commit 35477f9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 0.4.1 - TBD
## 0.5.0 - TBD

### Added

Expand All @@ -18,7 +18,10 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- Nothing.
- [#22](https://github.com/zendframework/zend-component-installer/pull/22) and
[#25](https://github.com/zendframework/zend-component-installer/pull/25) fix
a bug whereby escaped namespace separators caused detection of a module in
existing configuration to produce a false negative.

## 0.4.0 - 2016-10-11

Expand Down
3 changes: 2 additions & 1 deletion src/Injector/AbstractInjector.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ public function remove($package, IOInterface $io)
*/
protected function isRegisteredInConfig($package, $config)
{
return (1 === preg_match(sprintf($this->isRegisteredPattern, preg_quote($package, '/')), $config));
return preg_match(sprintf($this->isRegisteredPattern, preg_quote($package, '/')), $config)
|| preg_match(sprintf($this->isRegisteredPattern, preg_quote(addslashes($package), '/')), $config);
}
}
9 changes: 5 additions & 4 deletions test/Injector/ApplicationConfigInjectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ public function packageAlreadyRegisteredProvider()
{
// @codingStandardsIgnoreStart
return [
'component-long-array' => ['<' . "?php\nreturn array(\n 'modules' => array(\n 'Foo\Bar',\n 'Application',\n )\n);", ApplicationConfigInjector::TYPE_COMPONENT],
'component-short-array' => ['<' . "?php\nreturn [\n 'modules' => [\n 'Foo\Bar',\n 'Application',\n ]\n];", ApplicationConfigInjector::TYPE_COMPONENT],
'module-long-array' => ['<' . "?php\nreturn array(\n 'modules' => array(\n 'Application',\n 'Foo\Bar',\n )\n);", ApplicationConfigInjector::TYPE_MODULE],
'module-short-array' => ['<' . "?php\nreturn [\n 'modules' => [\n 'Application',\n 'Foo\Bar',\n ]\n];", ApplicationConfigInjector::TYPE_MODULE],
'component-long-array' => ['<' . "?php\nreturn array(\n 'modules' => array(\n 'Foo\Bar',\n 'Application',\n )\n);", ApplicationConfigInjector::TYPE_COMPONENT],
'component-short-array' => ['<' . "?php\nreturn [\n 'modules' => [\n 'Foo\Bar',\n 'Application',\n ]\n];", ApplicationConfigInjector::TYPE_COMPONENT],
'component-escaped-slashes' => ['<' . "?php\nreturn [\n 'modules' => [\n 'Foo\\\\Bar',\n 'Application',\n ]\n];", ApplicationConfigInjector::TYPE_COMPONENT],
'module-long-array' => ['<' . "?php\nreturn array(\n 'modules' => array(\n 'Application',\n 'Foo\Bar',\n )\n);", ApplicationConfigInjector::TYPE_MODULE],
'module-short-array' => ['<' . "?php\nreturn [\n 'modules' => [\n 'Application',\n 'Foo\Bar',\n ]\n];", ApplicationConfigInjector::TYPE_MODULE],
];
// @codingStandardsIgnoreEnd
}
Expand Down

0 comments on commit 35477f9

Please sign in to comment.