Ticket #2367: 2367.patch
File 2367.patch, 10.4 KB (added by , 12 years ago) |
---|
-
includes/common/ajax.php
21 21 * @uses bbp_get_ajax_url() To get the URL to use for AJAX requests 22 22 */ 23 23 function bbp_ajax_url() { 24 echo bbp_get_ajax_url();24 echo esc_url( bbp_get_ajax_url() ); 25 25 } 26 26 /** 27 27 * Return the URL to use for theme-side bbPress AJAX requests -
includes/common/template-tags.php
24 24 * @param string $path Additional path with leading slash 25 25 */ 26 26 function bbp_forums_url( $path = '/' ) { 27 echo bbp_get_forums_url( $path);27 echo esc_url( bbp_get_forums_url( $path ) ); 28 28 } 29 29 /** 30 30 * Return the forum URL … … 48 48 * @param string $path Additional path with leading slash 49 49 */ 50 50 function bbp_topics_url( $path = '/' ) { 51 echo bbp_get_topics_url( $path);51 echo esc_url( bbp_get_topics_url( $path ) ); 52 52 } 53 53 /** 54 54 * Return the forum URL … … 1944 1944 * @uses bbp_get_view_url() To get the view url 1945 1945 */ 1946 1946 function bbp_view_url( $view = false ) { 1947 echo bbp_get_view_url( $view);1947 echo esc_url( bbp_get_view_url( $view ) ); 1948 1948 } 1949 1949 /** 1950 1950 * Return the view url -
includes/forums/template-tags.php
230 230 * @uses bbp_get_forum_permalink() To get the permalink 231 231 */ 232 232 function bbp_forum_permalink( $forum_id = 0 ) { 233 echo bbp_get_forum_permalink( $forum_id);233 echo esc_url( bbp_get_forum_permalink( $forum_id ) ); 234 234 } 235 235 /** 236 236 * Return the link to the forum … … 806 806 * permanent link 807 807 */ 808 808 function bbp_forum_last_topic_permalink( $forum_id = 0 ) { 809 echo bbp_get_forum_last_topic_permalink( $forum_id);809 echo esc_url( bbp_get_forum_last_topic_permalink( $forum_id ) ); 810 810 } 811 811 /** 812 812 * Return the link to the last topic in a forum … … 948 948 * @uses bbp_get_forum_last_reply_permalink() To get the forum last reply link 949 949 */ 950 950 function bbp_forum_last_reply_permalink( $forum_id = 0 ) { 951 echo bbp_get_forum_last_reply_permalink( $forum_id);951 echo esc_url( bbp_get_forum_last_reply_permalink( $forum_id ) ); 952 952 } 953 953 /** 954 954 * Return the link to the last reply in a forum … … 977 977 * @uses bbp_get_forum_last_reply_url() To get the forum last reply url 978 978 */ 979 979 function bbp_forum_last_reply_url( $forum_id = 0 ) { 980 echo bbp_get_forum_last_reply_url( $forum_id);980 echo esc_url( bbp_get_forum_last_reply_url( $forum_id ) ); 981 981 } 982 982 /** 983 983 * Return the url to the last reply in a forum -
includes/replies/template-tags.php
366 366 * @uses bbp_get_reply_permalink() To get the reply permalink 367 367 */ 368 368 function bbp_reply_permalink( $reply_id = 0 ) { 369 echo bbp_get_reply_permalink( $reply_id);369 echo esc_url( bbp_get_reply_permalink( $reply_id ) ); 370 370 } 371 371 /** 372 372 * Return the link to the reply … … 394 394 * @uses bbp_get_reply_url() To get the reply url 395 395 */ 396 396 function bbp_reply_url( $reply_id = 0 ) { 397 echo bbp_get_reply_url( $reply_id);397 echo esc_url( bbp_get_reply_url( $reply_id ) ); 398 398 } 399 399 /** 400 400 * Return the paginated url to the reply in the reply loop … … 1180 1180 * @uses bbp_get_reply_author_url() To get the reply author url 1181 1181 */ 1182 1182 function bbp_reply_author_url( $reply_id = 0 ) { 1183 echo bbp_get_reply_author_url( $reply_id);1183 echo esc_url( bbp_get_reply_author_url( $reply_id ) ); 1184 1184 } 1185 1185 /** 1186 1186 * Return the author url of the reply … … 1851 1851 * @uses bbp_get_reply_edit_url() To get the reply edit url 1852 1852 */ 1853 1853 function bbp_reply_edit_url( $reply_id = 0 ) { 1854 echo bbp_get_reply_edit_url( $reply_id);1854 echo esc_url( bbp_get_reply_edit_url( $reply_id ) ); 1855 1855 } 1856 1856 /** 1857 1857 * Return URL to the reply edit page -
includes/search/template-tags.php
246 246 * @uses bbp_get_search_url() To get the search url 247 247 */ 248 248 function bbp_search_url() { 249 echo bbp_get_search_url();249 echo esc_url( bbp_get_search_url() ); 250 250 } 251 251 /** 252 252 * Return the search url … … 284 284 * @uses bbp_get_search_url() To get the search url 285 285 */ 286 286 function bbp_search_results_url() { 287 echo bbp_get_search_results_url();287 echo esc_url( bbp_get_search_results_url() ); 288 288 } 289 289 /** 290 290 * Return the search url -
includes/topics/template-tags.php
512 512 * @uses bbp_get_topic_permalink() To get the topic permalink 513 513 */ 514 514 function bbp_topic_permalink( $topic_id = 0, $redirect_to = '' ) { 515 echo bbp_get_topic_permalink( $topic_id, $redirect_to);515 echo esc_url( bbp_get_topic_permalink( $topic_id, $redirect_to ) ); 516 516 } 517 517 /** 518 518 * Return the link to the topic … … 1476 1476 * @uses bbp_get_topic_author_url() To get the topic author url 1477 1477 */ 1478 1478 function bbp_topic_author_url( $topic_id = 0 ) { 1479 echo bbp_get_topic_author_url( $topic_id);1479 echo esc_url( bbp_get_topic_author_url( $topic_id ) ); 1480 1480 } 1481 1481 1482 1482 /** … … 1814 1814 * @uses bbp_get_topic_last_reply_permalink() To get the topic's last reply link 1815 1815 */ 1816 1816 function bbp_topic_last_reply_permalink( $topic_id = 0 ) { 1817 echo bbp_get_topic_last_reply_permalink( $topic_id);1817 echo esc_url( bbp_get_topic_last_reply_permalink( $topic_id ) ); 1818 1818 } 1819 1819 /** 1820 1820 * Return the link to the last reply in a topic … … 1843 1843 * @uses bbp_get_topic_last_reply_url() To get the topic last reply url 1844 1844 */ 1845 1845 function bbp_topic_last_reply_url( $topic_id = 0 ) { 1846 echo bbp_get_topic_last_reply_url( $topic_id);1846 echo esc_url( bbp_get_topic_last_reply_url( $topic_id ) ); 1847 1847 } 1848 1848 /** 1849 1849 * Return the link to the last reply in a topic … … 1906 1906 $time_since = bbp_get_topic_last_active_time( $topic_id ); 1907 1907 1908 1908 if ( !empty( $time_since ) ) 1909 $anchor = '<a href="' . $link_url . '" title="' . esc_attr( $title ) . '">' . $time_since. '</a>';1909 $anchor = '<a href="' . esc_url( $link_url ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $time_since ) . '</a>'; 1910 1910 else 1911 1911 $anchor = __( 'No Replies', 'bbpress' ); 1912 1912 … … 2358 2358 if ( empty( $uri ) ) 2359 2359 return; 2360 2360 2361 $retval = $r['link_before'] . '<a href="' . $uri. '">' . $r['edit_text'] . '</a>' . $r['link_after'];2361 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '">' . $r['edit_text'] . '</a>' . $r['link_after']; 2362 2362 2363 2363 return apply_filters( 'bbp_get_topic_edit_link', $retval, $r ); 2364 2364 } … … 2372 2372 * @uses bbp_get_topic_edit_url() To get the topic edit url 2373 2373 */ 2374 2374 function bbp_topic_edit_url( $topic_id = 0 ) { 2375 echo bbp_get_topic_edit_url( $topic_id);2375 echo esc_url( bbp_get_topic_edit_url( $topic_id ) ); 2376 2376 } 2377 2377 /** 2378 2378 * Return URL to the topic edit page … … 3242 3242 * @uses bbp_get_topic_tag_link() 3243 3243 */ 3244 3244 function bbp_topic_tag_link( $tag = '' ) { 3245 echo bbp_get_topic_tag_link( $tag);3245 echo esc_url( bbp_get_topic_tag_link( $tag ) ); 3246 3246 } 3247 3247 /** 3248 3248 * Return the link of the current tag … … 3286 3286 * @uses bbp_get_topic_tag_edit_link() 3287 3287 */ 3288 3288 function bbp_topic_tag_edit_link( $tag = '' ) { 3289 echo bbp_get_topic_tag_edit_link( $tag);3289 echo esc_url( bbp_get_topic_tag_edit_link( $tag ) ); 3290 3290 } 3291 3291 /** 3292 3292 * Return the link of the current tag -
includes/users/template-tags.php
255 255 return false; 256 256 257 257 $user = get_userdata( $user_id ); 258 $name = esc_attr( $user->display_name ); 259 $user_link = '<a href="' . bbp_get_user_profile_url( $user_id ) . '">' . $name . '</a>'; 258 $user_link = '<a href="' . esc_url( bbp_get_user_profile_url( $user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>'; 260 259 261 260 return apply_filters( 'bbp_get_user_profile_link', $user_link, $user_id ); 262 261 } … … 323 322 * @uses bbp_get_user_profile_url() To get user profile url 324 323 */ 325 324 function bbp_user_profile_url( $user_id = 0, $user_nicename = '' ) { 326 echo bbp_get_user_profile_url( $user_id, $user_nicename);325 echo esc_url( bbp_get_user_profile_url( $user_id, $user_nicename ) ); 327 326 } 328 327 /** 329 328 * Return URL to the profile page of a user … … 406 405 return false; 407 406 408 407 $user = get_userdata( $user_id ); 409 $name = $user->display_name; 410 $edit_link = '<a href="' . bbp_get_user_profile_url( $user_id ) . '">' . $name . '</a>'; 408 $edit_link = '<a href="' . esc_url( bbp_get_user_profile_url( $user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>'; 411 409 return apply_filters( 'bbp_get_user_profile_edit_link', $edit_link, $user_id ); 412 410 } 413 411 … … 421 419 * @uses bbp_get_user_profile_edit_url() To get user profile edit url 422 420 */ 423 421 function bbp_user_profile_edit_url( $user_id = 0, $user_nicename = '' ) { 424 echo bbp_get_user_profile_edit_url( $user_id, $user_nicename);422 echo esc_url( bbp_get_user_profile_edit_url( $user_id, $user_nicename ) ); 425 423 } 426 424 /** 427 425 * Return URL to the profile edit page of a user … … 562 560 'after' => '' 563 561 ), 'get_admin_link' ); 564 562 565 $retval = $r['before'] . '<a href="' . admin_url() . '">' . $r['text'] . '</a>' . $r['after'];563 $retval = $r['before'] . '<a href="' . esc_url( admin_url() ) . '">' . $r['text'] . '</a>' . $r['after']; 566 564 567 565 return apply_filters( 'bbp_get_admin_link', $retval, $r ); 568 566 } … … 625 623 * @uses bbp_get_favorites_permalink() To get the favorites permalink 626 624 */ 627 625 function bbp_favorites_permalink( $user_id = 0 ) { 628 echo bbp_get_favorites_permalink( $user_id);626 echo esc_url( bbp_get_favorites_permalink( $user_id ) ); 629 627 } 630 628 /** 631 629 * Return the link to the user's favorites page (profile page) … … 787 785 * @uses bbp_get_subscriptions_permalink() To get the subscriptions link 788 786 */ 789 787 function bbp_subscriptions_permalink( $user_id = 0 ) { 790 echo bbp_get_subscriptions_permalink( $user_id);788 echo esc_url( bbp_get_subscriptions_permalink( $user_id ) ); 791 789 } 792 790 /** 793 791 * Return the link to the user's subscriptions page (profile page) … … 1115 1113 * @uses bbp_get_favorites_permalink() To get the favorites permalink 1116 1114 */ 1117 1115 function bbp_user_topics_created_url( $user_id = 0 ) { 1118 echo bbp_get_user_topics_created_url( $user_id);1116 echo esc_url( bbp_get_user_topics_created_url( $user_id ) ); 1119 1117 } 1120 1118 /** 1121 1119 * Return the link to the user's topics … … 1175 1173 * @uses bbp_get_favorites_permalink() To get the favorites permalink 1176 1174 */ 1177 1175 function bbp_user_replies_created_url( $user_id = 0 ) { 1178 echo bbp_get_user_replies_created_url( $user_id);1176 echo esc_url( bbp_get_user_replies_created_url( $user_id ) ); 1179 1177 } 1180 1178 /** 1181 1179 * Return the link to the user's replies