diff options
Diffstat (limited to 'plugins/jetpack/modules/minileven/minileven.php')
-rw-r--r-- | plugins/jetpack/modules/minileven/minileven.php | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/plugins/jetpack/modules/minileven/minileven.php b/plugins/jetpack/modules/minileven/minileven.php index abfec53d..2e649dd1 100644 --- a/plugins/jetpack/modules/minileven/minileven.php +++ b/plugins/jetpack/modules/minileven/minileven.php @@ -8,7 +8,7 @@ // http://alexking.org/projects/wordpress // // Released under the GPL license -// http://www.opensource.org/licenses/gpl-license.php +// https://www.opensource.org/licenses/gpl-license.php // // ********************************************************************** // This program is distributed in the hope that it will be useful, but @@ -117,13 +117,26 @@ function jetpack_mobile_template( $theme ) { } function jetpack_mobile_available() { - echo '<div class="jetpack-mobile-link" style="text-align:center;margin:10px 0;"><a href="'. esc_url( home_url( add_query_arg('ak_action', 'accept_mobile') ) ) . '">' . __( 'View Mobile Site', 'jetpack' ) . '</a></div>'; + /* + * Create HTML markup with a link to "View Mobile Site". + * The link adds "ak_action=accept_mobile" to the current URL. + */ + global $wp; + $url_params = array( + 'ak_action' => 'accept_mobile', + ); + if ( is_array( $_GET ) && ! empty( $_GET ) ) { + $url_params[] = $_GET; + } + $target_url = home_url( add_query_arg( $url_params, $wp->request ) ); + $anchor = '<a href="' . esc_url( $target_url ) . '">' . __( 'View Mobile Site', 'jetpack' ) . '</a>'; + echo '<div class="jetpack-mobile-link" style="text-align:center;margin:10px 0;">' . $anchor . '</div>'; } function jetpack_mobile_request_handler() { global $wpdb; if (isset($_GET['ak_action'])) { - $url = parse_url( get_bloginfo( 'url' ) ); + $url = wp_parse_url( get_bloginfo( 'url' ) ); $domain = $url['host']; if (!empty($url['path'])) { $path = $url['path']; @@ -207,7 +220,7 @@ function jetpack_mobile_theme_setup() { exit; break; case 'ios': - header( 'Location: http://itunes.apple.com/us/app/wordpress/id335703880?mt=8' ); + header( 'Location: https://itunes.apple.com/us/app/wordpress/id335703880?mt=8' ); exit; break; case 'blackberry': |