mirror of
git://develop.git.wordpress.org/
synced 2025-02-26 09:33:46 +01:00
XML-RPC: Save enclosures with a trailing new line. fixes #23219.
git-svn-id: https://develop.svn.wordpress.org/trunk@24623 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e62170f6e2
commit
9d6d4ce11d
@ -4316,16 +4316,14 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
|
||||
function add_enclosure_if_new( $post_ID, $enclosure ) {
|
||||
if ( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) {
|
||||
|
||||
$encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'];
|
||||
$encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] . "\n";
|
||||
$found = false;
|
||||
foreach ( (array) get_post_custom($post_ID) as $key => $val) {
|
||||
if ($key == 'enclosure') {
|
||||
foreach ( (array) $val as $enc ) {
|
||||
if ($enc == $encstring) {
|
||||
if ( $enclosures = get_post_meta( $post_ID, 'enclosure' ) ) {
|
||||
foreach ( $enclosures as $enc ) {
|
||||
// This method used to omit the trailing new line. #23219
|
||||
if ( rtrim( $enc, "\n" ) == rtrim( $encstring, "\n" ) ) {
|
||||
$found = true;
|
||||
break 2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user