WordPress.org

Make WordPress Core

Changeset 25564


Ignore:
Timestamp:
09/22/2013 06:38:56 PM (8 years ago)
Author:
DrewAPicture
Message:

Improve inline documentation for wp-trackback.php.

Props kpdesign.
Fixes #25377.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-trackback.php

    r25273 r25564  
    11<?php
    22/**
    3  * Handle Trackbacks and Pingbacks sent to WordPress
     3 * Handle Trackbacks and Pingbacks Sent to WordPress
     4 *
     5 * @since 0.71
    46 *
    57 * @package WordPress
     8 * @subpackage Trackbacks
    69 */
    710
     
    1215
    1316/**
    14  * trackback_response() - Respond with an error or success XML message
     17 * Response to a trackback.
    1518 *
    16  * @param int|bool $error Whether there was an error
    17  * @param string $error_message Error message if an error occurred
     19 * Responds with an error or success XML message.
     20 *
     21 * @since 0.71
     22 *
     23 * @param int|bool $error         Whether there was an error.
     24 *                                Default '0'. Accepts '0' or '1'.
     25 * @param string   $error_message Error message if an error occurred.
    1826 */
    1927function trackback_response($error = 0, $error_message = '') {
     
    3442}
    3543
    36 // trackback is done by a POST
     44// Trackback is done by a POST.
    3745$request_array = 'HTTP_POST_VARS';
    3846
     
    4553$charset = isset($_POST['charset']) ? $_POST['charset'] : '';
    4654
    47 // These three are stripslashed here so that they can be properly escaped after mb_convert_encoding()
     55// These three are stripslashed here so they can be properly escaped after mb_convert_encoding().
    4856$title     = isset($_POST['title'])     ? wp_unslash($_POST['title'])      : '';
    4957$excerpt   = isset($_POST['excerpt'])   ? wp_unslash($_POST['excerpt'])    : '';
     
    5563    $charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS';
    5664
    57 // No valid uses for UTF-7
     65// No valid uses for UTF-7.
    5866if ( false !== strpos($charset, 'UTF-7') )
    5967    die;
    6068
    61 if ( function_exists('mb_convert_encoding') ) { // For international trackbacks
     69// For international trackbacks.
     70if ( function_exists('mb_convert_encoding') ) {
    6271    $title     = mb_convert_encoding($title, get_option('blog_charset'), $charset);
    6372    $excerpt   = mb_convert_encoding($excerpt, get_option('blog_charset'), $charset);
     
    6574}
    6675
    67 // Now that mb_convert_encoding() has been given a swing, we need to escape these three
     76// Now that mb_convert_encoding() has been given a swing, we need to escape these three.
    6877$title     = wp_slash($title);
    6978$excerpt   = wp_slash($excerpt);
     
    7786
    7887if (empty($title) && empty($tb_url) && empty($blog_name)) {
    79     // If it doesn't look like a trackback at all...
     88    // If it doesn't look like a trackback at all.
    8089    wp_redirect(get_permalink($tb_id));
    8190    exit;
     
    111120     *
    112121     * @since 1.2.0
     122     *
    113123     * @param int $trackback_id Trackback ID.
    114124     */
Note: See TracChangeset for help on using the changeset viewer.