Skip to content

Commit 9da3e31

Browse files
Merge pull request #43 from Sesquipedalian/directory_separator
Handles DIRECTORY_SEPARATOR correctly in check-smf-index.php
2 parents 7589534 + de500bc commit 9da3e31

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

check-smf-index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
<?php
2222
2323
// Try to handle it with the upper level index.php. (it should know what to do.)
24-
if (file_exists(dirname(__DIR__) . '/index.php')) {
25-
include dirname(__DIR__) . '/index.php';
24+
if (file_exists(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'index.php')) {
25+
include dirname(__DIR__) . DIRECTORY_SEPARATOR . 'index.php';
2626
} else {
2727
exit;
2828
}
@@ -51,7 +51,7 @@
5151
throw new Exception('Index file missing in ' . $currentDirectory);
5252
}
5353

54-
if (file_get_contents($currentDirectory . '/index.php') != $contents) {
54+
if (!\in_array(file_get_contents($path . '/index.php'), [$contents, str_replace('DIRECTORY_SEPARATOR . \'index.php\'', '\'/index.php\'', $contents)])) {
5555
throw new Exception('Index content does not match in ' . $currentDirectory);
5656
}
5757
}

0 commit comments

Comments
 (0)