- fixed XSS issue with current profile URL

This commit is contained in:
nikitasinelnikov
2021-05-07 13:42:20 +03:00
parent 8e2adccba9
commit 60187cdc67
3 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -88,14 +88,14 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) {
if ( !$id = $wp_the_query->get_queried_object_id() )
return;
if( UM()->config()->permalinks['user'] == $id ) {
$link = $this->get_current_url();
if ( UM()->config()->permalinks['user'] == $id ) {
$link = esc_url( $this->get_current_url() );
echo "<link rel='canonical' href='$link' />\n";
return;
}
$link = get_permalink( $id );
if ( $page = get_query_var('cpage') ){
if ( $page = get_query_var( 'cpage' ) ){
$link = get_comments_pagenum_link( $page );
echo "<link rel='canonical' href='$link' />\n";
}
@@ -303,7 +303,7 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) {
* @return string
*/
function add_query( $key, $value ) {
$this->current_url = add_query_arg( $key, $value, $this->get_current_url() );
$this->current_url = add_query_arg( $key, $value, $this->get_current_url() );
return $this->current_url;
}