Skip to content
This repository was archived by the owner on Oct 6, 2021. It is now read-only.

Commit 58f96aa

Browse files
Fix hangar type detection.
1 parent 7897c3b commit 58f96aa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tools/hangar/src/Commands/Autorun.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,8 @@ protected function addautoRun(string $filename, string $dir): int
102102
*/
103103
protected function getType(string $path): string
104104
{
105-
$ds = \preg_quote(DIRECTORY_SEPARATOR, '#');
106-
if (\preg_match('#'.$ds.'.*?\.(.*)#', $path, $matches)) {
107-
$t = \strtolower($matches[1]);
105+
if (\preg_match('#/(.+?)\.([^\\.]+)$#', $path, $matches)) {
106+
$t = \strtolower($matches[2]);
108107
switch ($t) {
109108
case 'php':
110109
case 'php3':

0 commit comments

Comments
 (0)