Update DirectMessageController, disable exception logging for invalid urls. Fixes #2752

This commit is contained in:
Daniel Supernault 2021-06-01 21:18:02 -06:00
parent 69567e19df
commit 2d0a253e07
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 7 additions and 1 deletions

View file

@ -5,6 +5,7 @@ namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable; use Throwable;
use League\OAuth2\Server\Exception\OAuthServerException; use League\OAuth2\Server\Exception\OAuthServerException;
use Zttp\ConnectionException;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
@ -14,7 +15,8 @@ class Handler extends ExceptionHandler
* @var array * @var array
*/ */
protected $dontReport = [ protected $dontReport = [
OAuthServerException::class OAuthServerException::class,
ConnectionException::class
]; ];
/** /**

View file

@ -596,6 +596,10 @@ class DirectMessageController extends Controller
$q = $request->input('q'); $q = $request->input('q');
$r = $request->input('remote'); $r = $request->input('remote');
if(!Str::of($q)->contains('.')) {
return [];
}
if($r && Helpers::validateUrl($q)) { if($r && Helpers::validateUrl($q)) {
Helpers::profileFetch($q); Helpers::profileFetch($q);
} }