prevent bypassing YOURLS proxy URL filter, allowing to shorten non-self URLs

This commit is contained in:
El RIDO
2024-06-29 20:26:09 +02:00
parent 0eae149474
commit 2c711e9d3c
3 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ class YourlsProxy
*/
public function __construct(Configuration $conf, $link)
{
if (strpos($link, $conf->getKey('basepath') . '?') === false) {
if (strpos($link, $conf->getKey('basepath') . '?') !== 0) {
$this->_error = 'Trying to shorten a URL that isn\'t pointing at our instance.';
return;
}