From: Thomas Goirand <thomas@goirand.fr>
To: mlmmj@mlmmj.org
Subject: Re: [mlmmj] Subscribers management in php-admin
Date: Thu, 01 Mar 2012 15:07:45 +0000 [thread overview]
Message-ID: <4F4F90C1.1040003@goirand.fr> (raw)
In-Reply-To: <4F4BFAA7.4060702@pub.positon.org>
On 03/01/2012 09:08 PM, Marc MAURICE wrote:
> +if (isset($_POST["tosubscribe"])) {
> +
> + foreach (preg_split('/\r\n|\n|\r/', $_POST["tosubscribe"]) as $line) {
> + $email = trim($line);
> + if ($email != "") {
> + if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
> + $cmd = "/usr/bin/mlmmj-sub -L '/var/spool/mlmmj/".escapeshellarg($list)."' -a '".escapeshellarg($email)."' 2>&1";
> + exec($cmd, $out, $ret);
> + if ($ret != 0) {
> + $message.= "Subscribe error for $email <!--cmd=$cmd out=".implode($out)." ret=$ret--> <br/>";
> + }
> + } else {
> + $message.= "Email address not valid: $email <br/>";
If $email isn't valid, then it's even more a reason not to display it
(eg: unless you want to shoot yourself in the foot with issues like
cross site scripting...).
Also, I'm not sure what you are attempting with "displaying" the output
of the subscribing command in a HTML comment. Why not displaying it for
real, using htmlspecialchars() (which by the way, you didn't use, which
is dangerous) and ln2br() in a <pre> tag?
Thomas
next prev parent reply other threads:[~2012-03-01 15:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-27 21:50 [mlmmj] Subscribers management in php-admin Marc MAURICE
2012-02-28 9:25 ` Thomas Goirand
2012-02-28 9:47 ` Marc MAURICE
2012-02-28 14:29 ` Ben Schmidt
2012-02-29 3:09 ` Thomas Goirand
2012-02-29 3:57 ` Ben Schmidt
2012-03-01 13:08 ` Marc MAURICE
2012-03-01 15:07 ` Thomas Goirand [this message]
2012-03-02 12:59 ` Marc MAURICE
2012-03-04 14:05 ` Ben Schmidt
2012-03-05 12:02 ` Marc MAURICE
2012-03-06 8:45 ` Mads Martin Jørgensen
2012-03-11 13:06 ` Ben Schmidt
2012-03-11 13:46 ` Ben Schmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F4F90C1.1040003@goirand.fr \
--to=thomas@goirand.fr \
--cc=mlmmj@mlmmj.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox