Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative path finding fix #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Relative path finding fix #23

wants to merge 1 commit into from

Conversation

rmikalkenas
Copy link

If $this->localProjectDir = '/app' and $absolutePath = '/app/web/app_dev.php' then $relativePath = '/web_dev.php' and validatePathIsRelativeToProject throws InvalidConfigurationException.
As I understand it should remove absolute paths dir

If `$this->localProjectDir = '/app'` and `$absolutePath = '/app/web/app_dev.php'` then `$relativePath = '/web_dev.php'` and `validatePathIsRelativeToProject` throws `InvalidConfigurationException`.
As I understand it should remove absolute paths dir
@@ -272,6 +272,10 @@ public function controllersToRemove(array $paths) : self

$localRelativePaths = array_map(function ($absolutePath) {
$relativePath = str_replace($this->localProjectDir, '', $absolutePath);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, i wonder why don't we just replace this line to $relativePath = mb_substr($absolutePath, mb_strlen($this->localProjectDir)); instead?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok i get it now. Your solution indeed fix the issue you mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants