From: Raphaël Barrois Date: Thu, 24 Mar 2011 21:17:06 +0000 (+0100) Subject: Fix xnet subscription wrt + in emails (fight mod_rewrite double urldecode). X-Git-Tag: xorg/1.1.0~3 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=41905adf9ccbafac07240165ed6dd772f42509ea;p=platal.git Fix xnet subscription wrt + in emails (fight mod_rewrite double urldecode). Signed-off-by: Raphaël Barrois --- diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index c59dc8f..51917e8 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -659,6 +659,11 @@ class XnetGrpModule extends PLModule S::assert_xsrf_token(); $suggest_account_activation = false; + // FS#703 : $_GET is urldecoded twice, hence + // + (the data) => %2B (in the url) => + (first decoding) => ' ' (second decoding) + // Since there can be no spaces in emails, we can fix this with : + $email = str_replace(' ', '+', $email); + // Finds or creates account: first cases are for users with an account. if (!User::isForeignEmailAddress($email)) { // Standard account @@ -768,6 +773,11 @@ class XnetGrpModule extends PLModule { $page->changeTpl('xnetgrp/membres-suggest.tpl'); + // FS#703 : $_GET is urldecoded twice, hence + // + (the data) => %2B (in the url) => + (first decoding) => ' ' (second decoding) + // Since there can be no spaces in emails, we can fix this with : + $email = str_replace(' ', '+', $email); + if (Post::has('suggest')) { if (Post::t('suggest') == 'yes') { $user = S::user();