XML-RPC: Save enclosures with a trailing new line. fixes #23219.
git-svn-id: http://core.svn.wordpress.org/trunk@24623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b6c1023caa
commit
49bb647dda
|
@ -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…
Reference in New Issue