A slightly less shoddy looking reCAPTCHA fail page.
Also moving the reCAPTCHA checking code to before the links are added...
This commit is contained in:
18
result.php
18
result.php
@@ -1,6 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
include('header.php');
|
include('header.php');
|
||||||
|
|
||||||
|
$recaptcha_data = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . ISQ::$recaptcha['secret'] . '&response=' . $_REQUEST['g-recaptcha-response']);
|
||||||
|
$recaptcha_json = json_decode($recaptcha_data, TRUE);
|
||||||
|
|
||||||
|
// What happens when the CAPTCHA was completed incorrectly
|
||||||
|
if ($recaptcha_json['success'] != 'true') {
|
||||||
|
echo '<p class="error">' . yourls__( 'Are you a bot? Google thinks so. Go back and try again.', 'isq_translation' ) . '</p>';
|
||||||
|
include('footer.php');
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
$url = isset( $_REQUEST['url'] ) ? yourls_sanitize_url( $_REQUEST['url'] ) : '';
|
$url = isset( $_REQUEST['url'] ) ? yourls_sanitize_url( $_REQUEST['url'] ) : '';
|
||||||
$keyword = isset( $_REQUEST['keyword'] ) ? yourls_sanitize_keyword( $_REQUEST['keyword'] ) : '' ;
|
$keyword = isset( $_REQUEST['keyword'] ) ? yourls_sanitize_keyword( $_REQUEST['keyword'] ) : '' ;
|
||||||
$title = isset( $_REQUEST['title'] ) ? yourls_sanitize_title( $_REQUEST['title'] ) : '' ;
|
$title = isset( $_REQUEST['title'] ) ? yourls_sanitize_title( $_REQUEST['title'] ) : '' ;
|
||||||
@@ -10,14 +20,6 @@ $shorturl = isset( $return['shorturl'] ) ? $return['shorturl'] : '';
|
|||||||
$message = isset( $return['message'] ) ? $return['message'] : '';
|
$message = isset( $return['message'] ) ? $return['message'] : '';
|
||||||
$title = isset( $return['title'] ) ? $return['title'] : '';
|
$title = isset( $return['title'] ) ? $return['title'] : '';
|
||||||
|
|
||||||
$recaptcha_data = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . ISQ::$recaptcha['secret'] . '&response=' . $_REQUEST['g-recaptcha-response']);
|
|
||||||
$recaptcha_json = json_decode($recaptcha_data, TRUE);
|
|
||||||
|
|
||||||
if ($recaptcha_json['success'] != 'true') {
|
|
||||||
// What happens when the CAPTCHA was entered incorrectly
|
|
||||||
die ( '<p class="error" title="' . $resp->error . '">' . yourls__( 'Are you a bot? Google thinks so. Go back and try again.', 'isq_translation' ) . '</p></div></div>' );
|
|
||||||
}
|
|
||||||
|
|
||||||
// QR code shenanigans
|
// QR code shenanigans
|
||||||
if ( ISQ::$general['qr'] ) {
|
if ( ISQ::$general['qr'] ) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user