[ create a new paste ] login | about

Link: http://codepad.org/26XkxWZJ    [ raw code | output | fork ]

PHP, pasted on Jun 13:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$Contenu = '
$mail = array();
			$tab_options = explode("\n",str_replace("\r","",$page["destinataires"]));
			foreach($tab_options as $key=>$tab)	
			{
				$tab_option = explode("|",$tab);
				if(isset($tab_option[0]) && $tab_option[0]) $mail["emails_to"][$key]["email_to"] = (isset($tab_option[0]) && $tab_option[0]?$tab_option[0]:"");
				if(isset($tab_option[1]) && $tab_option[1]) $mail["emails_to"][$key]["email_to_name"] = (isset($tab_option[1]) && $tab_option[1]?$tab_option[1]:"");
			}
			$mail["email_from"] = "test";
			$mail["email_from_name"] = ucfirst(request("nom"))." ".ucfirst(request("prenom"));
			$mail["subject"] = "[".variable_get("rs")."] - Message du site";
			
			$mail["message"] = "Bonjour,<br /><br />Un prospect souhaiterait avoir des renseignements. <br />Voici les informations le concernant :<br />";
			
			foreach($form_fields as $key=>$value)
';

$CorrectionHTML = '\$mail["email_from"] = request("email");';
$NouveauContenu = preg_replace("/\$mail["email_from"](.+);/",$CorrectionHTML,$Contenu);
echo $NouveauContenu ;


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$Contenu = '
$mail = array();
			$tab_options = explode("\n",str_replace("\r","",$page["destinataires"]));
			foreach($tab_options as $key=>$tab)	
			{
				$tab_option = explode("|",$tab);
				if(isset($tab_option[0]) && $tab_option[0]) $mail["emails_to"][$key]["email_to"] = (isset($tab_option[0]) && $tab_option[0]?$tab_option[0]:"");
				if(isset($tab_option[1]) && $tab_option[1]) $mail["emails_to"][$key]["email_to_name"] = (isset($tab_option[1]) && $tab_option[1]?$tab_option[1]:"");
			}
			$mail["email_from"] = "test";
			$mail["email_from_name"] = ucfirst(request("nom"))." ".ucfirst(request("prenom"));
			$mail["subject"] = "[".variable_get("rs")."] - Message du site";
			
			$mail["message"] = "Bonjour,<br /><br />Un prospect souhaiterait avoir des renseignements. <br />Voici les informations le concernant :<br />";
			
			foreach($form_fields as $key=>$value)
';

$CorrectionHTML = '\$mail["email_from"] = request("email");';
$NouveauContenu = preg_replace("/\$mail["email_from"](.+);/",$CorrectionHTML,$Contenu);
echo $NouveauContenu ;


Create a new paste based on this one


Comments: