Skip to content

Commit

Permalink
Fix a bug where Craft would attempt to index transforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
andris-sevcenko committed Nov 27, 2018
1 parent 0281e84 commit b2543f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Fixed a bug where after impersonating another user, the Login page would show the impersonated user’s username rather than the admin’s.
- Fixed a bug where `craft\services\Sections::getAllSections()` could return stale results if a new section had been added recently. ([#3484](https://github.com/craftcms/cms/issues/3484))
- Fixed a bug where “View entry” and “View category” element actions weren’t available when viewing a specific section or category group.
- Fix a bug where Craft would attempt to index transforms.

### Security
- Updated jQuery File Upload to 9.28.0.
Expand Down
9 changes: 7 additions & 2 deletions src/services/AssetIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,13 @@ function($value) {
$path = $value['path'];
$segments = explode('/', $path);

foreach ($segments as $segment) {
if (isset($segment[0]) && $segment[0] === '_' && $value['type'] === 'dir') {
$segmentCount = count($segments);

for ($segmentIndex = 0; $segmentIndex < $segmentCount; $segmentIndex++) {
$currentSegment = $segments[$segmentIndex];

// Skip if segment begins with an underscrore and (this is a directory or not the last segment)
if ($currentSegment[0] === '_' && ($value['type'] === 'dir' || $segmentIndex + 1 < $segmentCount)) {
return false;
}
}
Expand Down

0 comments on commit b2543f6

Please sign in to comment.