WordPress.org

Make WordPress Core

Ticket #4873: 4873.001.diff

File 4873.001.diff, 1.6 KB (added by markjaquith, 7 years ago)

urlencode() in the themes for login links.

  • wp-content/themes/classic/comments.php

     
    3535<h2 id="postcomment"><?php _e('Leave a comment'); ?></h2> 
    3636 
    3737<?php if ( get_option('comment_registration') && !$user_ID ) : ?> 
    38 <p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.'), get_option('siteurl')."/wp-login.php?redirect_to=".get_the_permalink());?></p> 
     38<p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.'), get_option('siteurl')."/wp-login.php?redirect_to=".urlencode(get_permalink()));?></p> 
    3939<?php else : ?> 
    4040 
    4141<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> 
  • wp-content/themes/default/comments.php

     
    6666<h3 id="respond">Leave a Reply</h3> 
    6767 
    6868<?php if ( get_option('comment_registration') && !$user_ID ) : ?> 
    69 <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p> 
     69<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p> 
    7070<?php else : ?> 
    7171 
    7272<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">