Skip to content

Commit

Permalink
Fixed Craft::alias() for Windows
Browse files Browse the repository at this point in the history
Fixes #4405
  • Loading branch information
brandonkelly committed Jun 14, 2019
1 parent 2668cb1 commit 3eb805b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

### Fixed
- Fixed a bug where `Craft::dd()` wouldn’t work properly if output buffering was enabled. ([#4399](https://github.com/craftcms/cms/issues/4399))
- Fixed a bug where `Craft::alias()` wasn’t working on Windows servers. ([#4405](https://github.com/craftcms/cms/issues/4405))

## 3.1.30 - 2019-06-11

Expand Down
2 changes: 1 addition & 1 deletion lib/yii2/Yii.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static function alias(string $path): string

$path = FileHelper::normalizePath($path);
foreach (self::$_aliasPaths as $alias => $aliasPath) {
if (strpos($path . '/', $aliasPath . '/') === 0) {
if (strpos($path . DIRECTORY_SEPARATOR, $aliasPath . DIRECTORY_SEPARATOR) === 0) {
return $alias . substr($path, strlen($aliasPath));
}
}
Expand Down

0 comments on commit 3eb805b

Please sign in to comment.