bramus / bramus/mixed-content-scan
URLs with leading white space cause scanning problems
- Dominant language
- PHP
- Stars
- 517
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
When a page contains a URL with some leading white space, e.g. ``, the code assumes that it is a relative link and prepends the URL of the page of the site being scanned, so the URL gets queued as `https://mysite.com/ http://abc.com`. I fixed this by adding:
```
// trim white space
$linkedUrl = trim($linkedUrl);
```
at the start of the `private function absolutizeUrl($linkedUrl, $currentPageUrl)`
This seems to fix the problem, but I can't claim to be really familiar with the code, so I'd welcome any review before being incorporated.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with private function absolutizeUrl($linkedUrl, $currentPageUrl), where the issue identifies leading whitespace as the cause of incorrect URL classification. Review the proposed trimming behavior and verify that a whitespace-prefixed absolute URL is queued without the site's URL being prepended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100