1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Prevent bots from using buy now buttons

This commit is contained in:
Hillel Coren 2016-09-06 12:03:42 +03:00
parent b57deab66e
commit 4841ec38ce

View File

@ -6,6 +6,7 @@ use Utils;
use View;
use Auth;
use URL;
use Crawler;
use Exception;
use Validator;
use App\Models\Invitation;
@ -229,6 +230,10 @@ class OnlinePaymentController extends BaseController
public function handleBuyNow(ClientRepository $clientRepo, InvoiceService $invoiceService, $gatewayType = false)
{
if (Crawler::isCrawler()) {
return redirect()->to(NINJA_WEB_URL, 301);
}
$account = Account::whereAccountKey(Input::get('account_key'))->first();
$redirectUrl = Input::get('redirect_url', URL::previous());