Start work on better webmention support

This commit is contained in:
Jonny Barnes 2016-07-29 09:55:27 +01:00
parent 75cb5cf454
commit 5585483800
2 changed files with 16 additions and 22 deletions

View file

@ -28,7 +28,7 @@ class WebMentionsController extends Controller
}
//next check the $target is valid
$path = parse_url($request->input('target'))['path'];
$path = parse_url($request->input('target'), PHP_URL_PATH);
$pathParts = explode('/', $path);
switch ($pathParts[1]) {
@ -36,9 +36,8 @@ class WebMentionsController extends Controller
//we have a note
$noteId = $pathParts[2];
$numbers = new Numbers();
$realId = $numbers->b60tonum($noteId);
try {
$note = Note::findOrFail($realId);
$note = Note::findOrFail($numbers->b60tonum($noteId));
$this->dispatch(new ProcessWebMention($note, $request->input('source')));
} catch (ModelNotFoundException $e) {
return new Response('This note doesnt exist.', 400);