logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

cvs: pearweb /public_html/bugs bug.php: msg#00092

Subject: cvs: pearweb /public_html/bugs bug.php
dufuz           Sat Feb 18 15:30:35 2006 UTC

  Modified files:              
    /pearweb/public_html/bugs   bug.php 
  Log:
  Request #3401 Preview when adding comments
  
http://cvs.php.net/viewcvs.cgi/pearweb/public_html/bugs/bug.php?r1=1.92&r2=1.93&diff_format=u
Index: pearweb/public_html/bugs/bug.php
diff -u pearweb/public_html/bugs/bug.php:1.92 
pearweb/public_html/bugs/bug.php:1.93
--- pearweb/public_html/bugs/bug.php:1.92       Sat Feb 18 11:50:31 2006
+++ pearweb/public_html/bugs/bug.php    Sat Feb 18 15:30:35 2006
@@ -15,7 +15,7 @@
  * @package   Bugs
  * @copyright Copyright (c) 1997-2005 The PHP Group
  * @license   http://www.php.net/license/3_0.txt  PHP License
- * @version   $Id: bug.php,v 1.92 2006/02/18 11:50:31 pajoye Exp $
+ * @version   $Id: bug.php,v 1.93 2006/02/18 15:30:35 dufuz Exp $
  */
 
 /*
@@ -128,7 +128,7 @@
 // handle any updates, displaying errors if there were any
 $errors = array();
 
-if ($_POST['in'] && $edit == 3) {
+if ($_POST['in'] && !isset($_POST['preview'])  && $edit == 3) {
     // Submission of additional comment by others
 
     if (!validate_captcha()) {
@@ -171,6 +171,9 @@
         $dbh->query($query);
     }
     $from = rinse($_POST['in']['commentemail']);
+} elseif ($_POST['in'] && isset($_POST['preview']) && $edit == 3) {
+    $ncomment = trim($_POST['ncomment']);
+    $from = rinse($_POST['in']['commentemail']);
 
 } elseif ($_POST['in'] && $edit == 2) {
     // Edits submitted by original reporter
@@ -325,7 +328,6 @@
             $dbh->query($query);
         }
     }
-
 } elseif ($_POST['in']) {
     $errors[] = 'Invalid edit mode.';
     $ncomment = '';
@@ -333,7 +335,7 @@
     $ncomment = '';
 }
 
-if ($_POST['in']) {
+if ($_POST['in'] && !isset($_POST['preview'])) {
     if (!$errors) {
         mail_bug_updates($bug, $_POST['in'], $from, $ncomment, $edit);
         localRedirect(htmlspecialchars($_SERVER['PHP_SELF']) . 
"?id=$id&thanks=$edit");
@@ -742,6 +744,15 @@
         </div>
 
         <?php
+    } elseif (isset($_POST['preview']) && !empty($ncomment)) {
+        echo '<div class="comment">';
+        echo "<strong>[",format_date(time()),"] ";
+        echo spam_protect(htmlspecialchars($from))."</strong>\n";
+        echo '<pre class="note">';
+        $comment = make_ticket_links(addlinks($ncomment));
+        echo wordwrap($comment, 72);
+        echo "</pre>\n";
+        echo '</div>';
     }
 
     ?>
@@ -768,7 +779,7 @@
     <div>
      <textarea cols="60" rows="10" name="ncomment"
       wrap="physical"><?php echo clean($ncomment) ?></textarea>
-     <br /><input type="submit" value="Submit" />
+     <br /><input type="submit" name="preview" value="Preview">&nbsp;<input 
type="submit" value="Submit" />
     </div>
 
     </form>

-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>