Ticket #214: 01212_weblog_comments_noname.diff

File 01212_weblog_comments_noname.diff, 1.5 kB (added by rho, 1 year ago)
  • a/mod/blog/lib/weblogs_comments_add.php

    old new  
    3737                            ); 
    3838                             
    3939        if (logged_on) { 
    40             $comment_name = $_SESSION['name']; 
     40            $comment_name = htmlspecialchars($_SESSION['name'], ENT_COMPAT, 'utf-8'); 
     41            $run_result .= '<input type="hidden" name="postedname" value="'.$comment_name.'" />'; 
    4142        } else { 
    4243            $comment_name = __gettext("Guest"); 
     44 
     45            $run_result .= templates_draw(array( 
     46             
     47                                    'context' => 'databox1', 
     48                                    'name' => __gettext("Your name"), 
     49                                    'column1' => "<input type=\"text\" name=\"postedname\" value=\"".htmlspecialchars($comment_name, ENT_COMPAT, 'utf-8')."\" />" 
     50             
     51                                ) 
     52                                ); 
     53 
    4354        } 
    4455 
    45         $run_result .= templates_draw(array( 
    46          
    47                                 'context' => 'databox1', 
    48                                 'name' => __gettext("Your name"), 
    49                                 'column1' => "<input type=\"text\" name=\"postedname\" value=\"".htmlspecialchars($comment_name, ENT_COMPAT, 'utf-8')."\" />" 
    50          
    51                             ) 
    52                             ); 
    5356         
    5457        $run_result .= templates_draw(array( 
    5558