summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/sharedaddy/sharing-sources.php')
-rw-r--r--plugins/jetpack/modules/sharedaddy/sharing-sources.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/jetpack/modules/sharedaddy/sharing-sources.php b/plugins/jetpack/modules/sharedaddy/sharing-sources.php
index 0cc0ec59..d9954a96 100644
--- a/plugins/jetpack/modules/sharedaddy/sharing-sources.php
+++ b/plugins/jetpack/modules/sharedaddy/sharing-sources.php
@@ -1701,7 +1701,15 @@ class Jetpack_Share_WhatsApp extends Sharing_Source {
public function process_request( $post, array $post_data ) {
// Record stats
parent::process_request( $post, $post_data );
- $url = 'https://api.whatsapp.com/send?text=' . rawurlencode( $this->get_share_title( $post->ID ) . ' ' . $this->get_share_url( $post->ID ) );
+
+ // Firefox for desktop doesn't handle the "api.whatsapp.com" URL properly, so use "web.whatsapp.com"
+ if ( Jetpack_User_Agent_Info::is_firefox_desktop() ) {
+ $url = 'https://web.whatsapp.com/send?text=';
+ } else {
+ $url = 'https://api.whatsapp.com/send?text=';
+ }
+
+ $url .= rawurlencode( $this->get_share_title( $post->ID ) . ' ' . $this->get_share_url( $post->ID ) );
wp_redirect( $url );
exit;
}