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

Do not raise error "Do not use Localhost in your code" when "localhost" in comment #267

Open
1 task done
leoloso opened this issue Sep 22, 2023 · 0 comments · May be fixed by #278
Open
1 task done

Do not raise error "Do not use Localhost in your code" when "localhost" in comment #267

leoloso opened this issue Sep 22, 2023 · 0 comments · May be fixed by #278
Labels
[Type] Bug An existing feature is broken

Comments

@leoloso
Copy link

leoloso commented Sep 22, 2023

Is your enhancement related to a problem? Please describe.

I'm given the following error:

Do not use Localhost in your code. Detected: http://localhost

However, my code doesn't use localhost at all. The only occurrence is inside a comment (from a 3rd-party package):

/**
 * Returns the path being requested relative to the executed script.
 *
 * The path info always starts with a /.
 *
 * Suppose this request is instantiated from /mysite on localhost:
 *
 *  * http://localhost/mysite              returns an empty string
 *  * http://localhost/mysite/about        returns '/about'
 *  * http://localhost/mysite/enco%20ded   returns '/enco%20ded'
 *  * http://localhost/mysite/about?var=1  returns '/about'
 *
 * @return string The raw path (i.e. not urldecoded)
 */
public function getPathInfo(): string
{
    return $this->pathInfo ??= $this->preparePathInfo();
}

I guess the error should not be raised when the match happens inside a comment.

Designs

Screenshot 2023-09-22 at 12 01 33 PM

Describe alternatives you've considered

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bordoni bordoni added [Type] Bug An existing feature is broken Alpha Plugin labels Sep 22, 2023
@nielslange nielslange linked a pull request Sep 24, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants