WordPress.org

Make WordPress Core

Changeset 42893


Ignore:
Timestamp:
04/03/2018 02:58:48 PM (7 weeks ago)
Author:
ocean90
Message:

Template: Make sure the version string is correctly escaped for use in attributes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r42843 r42893  
    42504250    switch ( $type ) {
    42514251        case 'html':
    4252             $gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '">';
     4252            $gen = '<meta name="generator" content="WordPress ' . esc_attr( get_bloginfo( 'version' ) ) . '">';
    42534253            break;
    42544254        case 'xhtml':
    4255             $gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '" />';
     4255            $gen = '<meta name="generator" content="WordPress ' . esc_attr( get_bloginfo( 'version' ) ) . '" />';
    42564256            break;
    42574257        case 'atom':
    4258             $gen = '<generator uri="https://wordpress.org/" version="' . get_bloginfo_rss( 'version' ) . '">WordPress</generator>';
     4258            $gen = '<generator uri="https://wordpress.org/" version="' . esc_attr( get_bloginfo_rss( 'version' ) ) . '">WordPress</generator>';
    42594259            break;
    42604260        case 'rss2':
    4261             $gen = '<generator>https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '</generator>';
     4261            $gen = '<generator>' . esc_url_raw( 'https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) ) . '</generator>';
    42624262            break;
    42634263        case 'rdf':
    4264             $gen = '<admin:generatorAgent rdf:resource="https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '" />';
     4264            $gen = '<admin:generatorAgent rdf:resource="' . esc_url_raw( 'https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) ) . '" />';
    42654265            break;
    42664266        case 'comment':
    4267             $gen = '<!-- generator="WordPress/' . get_bloginfo( 'version' ) . '" -->';
     4267            $gen = '<!-- generator="WordPress/' . esc_attr( get_bloginfo( 'version' ) ) . '" -->';
    42684268            break;
    42694269        case 'export':
    4270             $gen = '<!-- generator="WordPress/' . get_bloginfo_rss( 'version' ) . '" created="' . date( 'Y-m-d H:i' ) . '" -->';
     4270            $gen = '<!-- generator="WordPress/' . esc_attr( get_bloginfo_rss( 'version' ) ) . '" created="' . date( 'Y-m-d H:i' ) . '" -->';
    42714271            break;
    42724272    }
Note: See TracChangeset for help on using the changeset viewer.