Changeset - r42:e7c378036e33
[Not reviewed]
default
0 1 0
Wolfgang Scherer (ws) - 7 years ago 2018-02-28 15:34:15
wolfgang.scherer@gmx.de
index.php: quoting for final message fixed.
1 file changed with 13 insertions and 10 deletions:
index.php
13
10
0 comments (0 inline, 0 general)
index.php
Show inline comments
 
@@ -341,47 +341,50 @@ if ($vacation_setup || $vacation_setup_r
 
        if (!$is_admin && !empty($vacation_forward_to) && !in_array($vacation_forward_to, $user_names)) {
 
            error_msg(sprintf('%s (%s)!', get_text('error_unknown_forward'), $vacation_forward_to));
 
            break;
 
        }
 
        // Actually set it
 

	
 
        if (!$FOOTER || $vacation_setup_raw || $x_wsv_raw) {
 
            $vacation_body_full = $vacation_body;
 
        } else {
 
            $vacation_body_full = str_replace("\n", "\r\n", str_replace("\r", "", rtrim(rtrim($vacation_body)."\n\n".$FOOTER)));
 
        }
 

	
 
        // Prepare vacation(1) message
 
        if (!empty($vacation_forward_to)) {
 
            header_set($vacation_headers, sprintf('X-WSV-Forward-To: %s', $vacation_forward_to));
 
        }
 
        if ( $vacation_setup_raw ) {
 
            $vacation_msg = message_join($vacation_headers, $vacation_body);
 
            $vacation_msg_in = message_join($vacation_headers, $vacation_body);
 
            $vacation_msg = message_join($vacation_headers, $vacation_body_full);
 
            // echo "<pre>"; // |:debug:|
 
            // var_dump($vacation_headers);
 
            // var_dump($vacation_body);
 
            // echo $vacation_msg;
 
            // echo "</pre>";
 
        } else {
 
            $vacation_msg = vacation_join($vacation_subject, $vacation_body, $vacation_headers);
 
            $vacation_msg_in = vacation_join($vacation_subject, $vacation_body, $vacation_headers);
 
            $vacation_msg = vacation_join($vacation_subject, $vacation_body_full, $vacation_headers);
 
        }
 
        $pipe_cmd = sprintf(
 
            '%s -u %s %s %s %s',
 
            $SUDO_CMD, $user, $SUDO_OPT_H, $WRITE_TO_CMD, $vacation_msg_in_file);
 
        // fprintf($stderr, "\$pipe_cmd: %s<br>\n", $pipe_cmd);
 

	
 
        $vacation_msg_pipe = popen($pipe_cmd, 'w');
 
        fwrite($vacation_msg_pipe, $vacation_msg);
 
        fwrite($vacation_msg_pipe, $vacation_msg_in);
 
        pclose($vacation_msg_pipe);
 

	
 
        $pipe_cmd = sprintf(
 
            '%s -u %s %s %s %s',
 
            $SUDO_CMD, $user, $SUDO_OPT_H, $WRITE_TO_CMD, $vacation_msg_file);
 
        // fprintf($stderr, "\$pipe_cmd: %s<br>\n", $pipe_cmd);
 

	
 
        $vacation_msg_pipe = popen($pipe_cmd, 'w');
 
        if (!$FOOTER || $vacation_setup_raw || $x_wsv_raw) {
 
            $full_msg = $vacation_msg;
 
        } else {
 
            $full_msg = rtrim(rtrim($vacation_msg)."\n".$FOOTER)."\n";
 
        }
 
        fwrite($vacation_msg_pipe, $full_msg);
 
        fwrite($vacation_msg_pipe, $vacation_msg);
 
        pclose($vacation_msg_pipe);
 

	
 
        // Initialize vacation(1) if necessary.
 
        if (!test_readable($vacation_db_file, $user)) {
 
            $cmd = sprintf(
 
                '%s -u %s %s %s %s',
 
@@ -582,13 +585,13 @@ if ($x_wsv_raw || $EXPERT_ENABLED)
 
#    $form[] = sshl('<a href="#">'.get_text('expert_mode').'</a>', 'expert-mode-head');
 
    $form[] = '<div>';
 
    // raw message
 
    $form[] = sprintf('<span class="label">%s<sup>*</sup>:</span>', get_text('message'));
 
    $form[] = (
 
        '<textarea name="message" cols="56" rows="'.$text_rows.'"'
 
        .' style="vertical-align: top; width: 440px;">' . htmlspecialchars($vacation_msg, ENT_NOQUOTES, "UTF-8") . '</textarea><br />');
 
        .' style="vertical-align: top; width: 440px;">' . htmlspecialchars($vacation_msg_in, ENT_NOQUOTES, "UTF-8") . '</textarea><br />');
 

	
 
    $form[] = '<span class="label">&nbsp;</span>';
 
    $form[] = (
 
        '<span style="display: inline-block; width: 440px; margin-top: 5px; font-size: 8pt;">'
 
        . get_text('explain_expert')
 
        .'</span><br />');
0 comments (0 inline, 0 general)