public_html/wp-content/plugins/google-document-embedder/libs/lib-secure.php
/**
 * Generate and store secure document link
 *
 * @since	2.5.0.3
 * @return  string Secure document link or false on failure
 */
Generate and store secure document link
@since       2.5.0.3
@return  string Secure document link or false on failure
Generate and store secure document link @since 2 . 5 . 0 . 3 @return string Secure document link or false on failure
function gde_make_secure_url( $url ) {
	global $wpdb;
	$table = $wpdb->prefix . 'gde_secure';
	$data = $wpdb->get_results( "SELECT * FROM $table WHERE url = '$url'", ARRAY_A );
	if ( ! empty( $data ) ) {
		$data = $data[0];
		return $data['murl'];
	} else {
		$newcode = gde_secure_code();
		$url_to_mask = GDE_PLUGIN_URL . "load.php?s=" . $newcode;
		$masked_url = gde_get_short_url( $url_to_mask );
		if ( ! $wpdb->insert(
				$table,
				array(
					'code'	=>	$newcode,
					'url'	=>	$url,
					'murl'	=>	$masked_url
				),
				array(
					'%s', '%s', '%s'
				)
			) ) {
			gde_dx_log("Unable to record secure URL in database");
			return false;
		} else {
			return $masked_url;
		}
	}
}
function gde_make_secure_url ( $ url ) { global $ wpdb ; $ table = $ wpdb -> prefix . 'gde_secure' ; $ data = $ wpdb -> get_results ( " SELECT * FROM  $ table  WHERE url = ' $ url ' " , ARRAY_A ) ; if ( ! empty ( $ data ) ) { $ data = $ data [ 0 ] ; return $ data [ 'murl' ] ; } else { $ newcode = gde_secure_code ( ) ; $ url_to_mask = GDE_PLUGIN_URL . " load.php?s= " . $ newcode ; $ masked_url = gde_get_short_url ( $ url_to_mask ) ; if ( ! $ wpdb -> insert ( $ table , array ( 'code' => $ newcode , 'url' => $ url , 'murl' => $ masked_url ) , array ( '%s' , '%s' , '%s' ) ) ) { gde_dx_log ( " Unable to record secure URL in database " ) ; return false ; } else { return $ masked_url ; } } }
Generate and store secure document link
 @since       2.5.0.3
 @return  string Secure document link or false on failure
Generate and store secure document link @since 2 . 5 . 0 . 3 @return string Secure document link or false on failure
// a secure url to this doc already exists // make a new entry