From 41905adf9ccbafac07240165ed6dd772f42509ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Thu, 24 Mar 2011 22:17:06 +0100 Subject: [PATCH] Fix xnet subscription wrt + in emails (fight mod_rewrite double urldecode). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- modules/xnetgrp.php | 10 ++++++++++ 1 file changed, 10 insertions(+) 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(); -- 2.1.4