Changeset 63036 for trunk/src/wp-includes/comment.php
- Timestamp:
- 08/06/2026 09:30:58 AM (2 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/comment.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r63012 r63036 21 21 * approved. 22 22 * 23 * Pingbacks originating from this site are automatically approved, as the link 24 * they report was created by someone who can already publish here. 25 * 23 26 * If all checks pass, the function will return true. 24 27 * 25 28 * @since 1.2.0 29 * @since 7.2.0 Pingbacks from this site are no longer held for moderation. 26 30 * 27 31 * @global wpdb $wpdb WordPress database abstraction object. … … 162 166 return false; 163 167 } 168 } elseif ( 'pingback' === $comment_type ) { 169 /* 170 * Only pingbacks are considered. A pingback is verified before it reaches 171 * this point: the source page is fetched, it must link to the target, and 172 * the comment is built from that fetched page. A trackback carries no such 173 * proof. Its source URL, title, and excerpt are unverified request data, so 174 * a forged trackback naming a local post as its source would be approved. 175 */ 176 177 // url_to_postid() compares hostnames, so it returns 0 for any URL that only appears to be local. 178 $source_id = url_to_postid( wp_unslash( $url ) ); 179 180 // Approve pingbacks reporting a link that someone who can already publish here created. 181 $approve_pingback = $source_id > 0 && 'publish' === get_post_status( $source_id ); 182 183 /** 184 * Filters whether a pingback is approved without being held for moderation. 185 * 186 * Defaults to true for pingbacks originating from a published post on this 187 * site, and false for every other pingback. Trackbacks are never considered, 188 * as they cannot be verified. 189 * 190 * @since 7.2.0 191 * 192 * @param bool $approve_pingback Whether to approve the pingback. 193 * @param int $source_id ID of the post on this site the pingback 194 * originated from, or 0 if it came from elsewhere. 195 * @param string $url The URL the pingback was sent from. 196 */ 197 return (bool) apply_filters( 'auto_approve_pingback', $approve_pingback, $source_id, $url ); 164 198 } else { 165 199 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)