' . yourls__( 'Copy to clipboard', 'isq_translation' ) . ''; } ?>
' . yourls__( 'Copy to clipboard', 'isq_translation' ) . ''; } ?>
' . yourls__( 'Copy to clipboard', 'isq_translation' ) . ''; } ?>
'; echo '
'; echo ''; if( !empty( $action ) ) { echo $action; } else { echo '' . yourls__( '← Go home and try again', 'isq_translation' ) . ''; } echo '
'; echo ''; include('footer.php'); die(); } if ( empty( $_REQUEST['url'] ) ) { display_error( yourls__( 'You haven\'t entered a URL to shorten.', 'isq_translation' ) ); }; // Check if the keyword is reserved if ( !empty( $_REQUEST['keyword'] ) && yourls_keyword_is_reserved( $_REQUEST['keyword'] ) ) { display_error( sprintf( yourls__( 'The keyword %1$s is reserved.'), '' . $_REQUEST['keyword'] . '' ) ); } // Check if the keyword is taken if ( !empty( $_REQUEST['keyword'] ) && yourls_keyword_is_taken( $_REQUEST['keyword'] ) ) { display_error( sprintf( yourls__( 'The keyword %1$s is taken.'), '' . $_REQUEST['keyword'] . '' ) ); } // Check what CAPTCHA method was used $antispam_method = $_REQUEST['antispam_method']; if ( $antispam_method == 'user_login' ) { // User is logged into YOURLS } else if ( $antispam_method == 'recaptcha' ) { // Google reCAPTCHA is enabled $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 reCAPTCHA was completed incorrectly if ( $recaptcha_json['success'] != 'true' ) { display_error( yourls__( 'Are you a bot? Google certainly thinks you are.', 'isq_translation' ) ); } } else if ( $antispam_method == 'basic' ) { // Basic antispam protection fallback // What happens when it was not completed correctly if ( $_REQUEST['basic_antispam'] != "" ) { display_error( yourls__( 'Are you a bot? The verification was not completed successfully.', 'isq_translation' ) ); } } else { // No antispam protection was detected display_error( yourls__( 'Are you a bot? No antispam protection was completed successfully.', 'isq_translation' ) ); } // Get parameters -- they will all be sanitized in yourls_add_new_link() $url = $_REQUEST['url']; $keyword = isset( $_REQUEST['keyword'] ) ? $_REQUEST['keyword'] : '' ; $title = isset( $_REQUEST['title'] ) ? $_REQUEST['title'] : '' ; $text = isset( $_REQUEST['text'] ) ? $_REQUEST['text'] : '' ; // Create short URL, receive array $return with various information $return = yourls_add_new_link( $url, $keyword, $title ); $shorturl = isset( $return['shorturl'] ) ? $return['shorturl'] : ''; $message = isset( $return['message'] ) ? $return['message'] : ''; $title = isset( $return['title'] ) ? $return['title'] : ''; $status = isset( $return['status'] ) ? $return['status'] : ''; // Check for all other errors if( empty( $shorturl ) ) { display_error( yourls__( 'The URL could not be shortened.', 'isq_translation' ) ); } // URL encoded links used in the social sharing buttons $encoded_shorturl = urlencode($shorturl); $encoded_title = urlencode($title); // Add dependencies if ( ISQ::$general['clipboard'] ) { $dependencies[] = 'ZeroClipboard'; }; ?>