<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[44785] trunk: Replace usages of basename() with wp_basename() in order to support multibyte filenames</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/44785">44785</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/44785","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>jorbin</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-03-01 20:57:26 +0000 (Fri, 01 Mar 2019)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Replace usages of basename() with wp_basename() in order to support multibyte filenames
This is focused on the pieces of code that touch media files and the tests that support them. `basename` isn't multibyte compatible out of the box. See http://php.net/basename and https://bugs.php.net/bug.php?id=62119.
See <a href="https://core.trac.wordpress.org/ticket/43170">#43170</a>.
Props Viper007Bond.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincustombackgroundphp">trunk/src/wp-admin/custom-background.php</a></li>
<li><a href="#trunksrcwpadmincustomheaderphp">trunk/src/wp-admin/custom-header.php</a></li>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpsiteiconphp">trunk/src/wp-admin/includes/class-wp-site-icon.php</a></li>
<li><a href="#trunksrcwpadminincludesimageeditphp">trunk/src/wp-admin/includes/image-edit.php</a></li>
<li><a href="#trunksrcwpadminincludesimagephp">trunk/src/wp-admin/includes/image.php</a></li>
<li><a href="#trunksrcwpadminincludesimportphp">trunk/src/wp-admin/includes/import.php</a></li>
<li><a href="#trunksrcwpadminincludesmediaphp">trunk/src/wp-admin/includes/media.php</a></li>
<li><a href="#trunksrcwpadminincludesmiscphp">trunk/src/wp-admin/includes/misc.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentytenloopattachmentphp">trunk/src/wp-content/themes/twentyten/loop-attachment.php</a></li>
<li><a href="#trunksrcwpincludesclasswpcustomizemanagerphp">trunk/src/wp-includes/class-wp-customize-manager.php</a></li>
<li><a href="#trunksrcwpincludescustomizeclasswpcustomizemediacontrolphp">trunk/src/wp-includes/customize/class-wp-customize-media-control.php</a></li>
<li><a href="#trunksrcwpincludesdeprecatedphp">trunk/src/wp-includes/deprecated.php</a></li>
<li><a href="#trunksrcwpincludesfunctionsphp">trunk/src/wp-includes/functions.php</a></li>
<li><a href="#trunksrcwpincludesmediaphp">trunk/src/wp-includes/media.php</a></li>
<li><a href="#trunksrcwpincludespostphp">trunk/src/wp-includes/post.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestattachmentscontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php</a></li>
<li><a href="#trunktestsphpunitincludesabstracttestcasephp">trunk/tests/phpunit/includes/abstract-testcase.php</a></li>
<li><a href="#trunktestsphpunitincludesfactoryclasswpunittestfactoryforattachmentphp">trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-attachment.php</a></li>
<li><a href="#trunktestsphpunittestsajaxAttachmentsphp">trunk/tests/phpunit/tests/ajax/Attachments.php</a></li>
<li><a href="#trunktestsphpunittestsajaxMediaEditphp">trunk/tests/phpunit/tests/ajax/MediaEdit.php</a></li>
<li><a href="#trunktestsphpunittestsblocksblockparserphp">trunk/tests/phpunit/tests/blocks/block-parser.php</a></li>
<li><a href="#trunktestsphpunittestsblocksrenderphp">trunk/tests/phpunit/tests/blocks/render.php</a></li>
<li><a href="#trunktestsphpunittestsgeneraltemplatephp">trunk/tests/phpunit/tests/general/template.php</a></li>
<li><a href="#trunktestsphpunittestsimageeditorphp">trunk/tests/phpunit/tests/image/editor.php</a></li>
<li><a href="#trunktestsphpunittestsimageintermediateSizephp">trunk/tests/phpunit/tests/image/intermediateSize.php</a></li>
<li><a href="#trunktestsphpunittestsimageresizephp">trunk/tests/phpunit/tests/image/resize.php</a></li>
<li><a href="#trunktestsphpunittestsimagesiteIconphp">trunk/tests/phpunit/tests/image/siteIcon.php</a></li>
<li><a href="#trunktestsphpunittestsmediaphp">trunk/tests/phpunit/tests/media.php</a></li>
<li><a href="#trunktestsphpunittestspostattachmentsphp">trunk/tests/phpunit/tests/post/attachments.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestattachmentscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetMediaItemphp">trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincustombackgroundphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/custom-background.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/custom-background.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-admin/custom-background.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -494,7 +494,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = $file['url'];
</span><span class="cx" style="display: block; padding: 0 10px"> $type = $file['type'];
</span><span class="cx" style="display: block; padding: 0 10px"> $file = $file['file'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $filename = basename( $file );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $filename = wp_basename( $file );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Construct the object array
</span><span class="cx" style="display: block; padding: 0 10px"> $object = array(
</span></span></pre></div>
<a id="trunksrcwpadmincustomheaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/custom-header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/custom-header.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-admin/custom-header.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -820,7 +820,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->finished();
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $width > $max_width ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $oitar = $width / $max_width;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $image = wp_crop_image( $attachment_id, 0, 0, $width, $height, $max_width, $height / $oitar, false, str_replace( basename( $file ), 'midsize-' . basename( $file ), $file ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $image = wp_crop_image( $attachment_id, 0, 0, $width, $height, $max_width, $height / $oitar, false, str_replace( wp_basename( $file ), 'midsize-' . wp_basename( $file ), $file ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $image || is_wp_error( $image ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -828,7 +828,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-admin/custom-header.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $image = apply_filters( 'wp_create_file_in_uploads', $image, $attachment_id ); // For replication
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = str_replace( basename( $url ), basename( $image ), $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = str_replace( wp_basename( $url ), wp_basename( $image ), $url );
</ins><span class="cx" style="display: block; padding: 0 10px"> $width = $width / $oitar;
</span><span class="cx" style="display: block; padding: 0 10px"> $height = $height / $oitar;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -895,7 +895,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = $file['url'];
</span><span class="cx" style="display: block; padding: 0 10px"> $type = $file['type'];
</span><span class="cx" style="display: block; padding: 0 10px"> $file = $file['file'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $filename = basename( $file );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $filename = wp_basename( $file );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Construct the object array
</span><span class="cx" style="display: block; padding: 0 10px"> $object = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -984,7 +984,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Cleanup.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $medium = str_replace( wp_basename( $original ), 'midsize-' . wp_basename( $original ), $original );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( file_exists( $medium ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_file( $medium );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1208,7 +1208,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> final public function create_attachment_object( $cropped, $parent_attachment_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $parent = get_post( $parent_attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_url = wp_get_attachment_url( $parent->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = str_replace( basename( $parent_url ), basename( $cropped ), $parent_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $size = @getimagesize( $cropped );
</span><span class="cx" style="display: block; padding: 0 10px"> $image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1215,7 +1215,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $object = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'ID' => $parent_attachment_id,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_title' => basename( $cropped ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_title' => wp_basename( $cropped ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'post_mime_type' => $image_type,
</span><span class="cx" style="display: block; padding: 0 10px"> 'guid' => $url,
</span><span class="cx" style="display: block; padding: 0 10px"> 'context' => 'custom-header',
</span></span></pre></div>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/ajax-actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ajax-actions.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-admin/includes/ajax-actions.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3651,13 +3651,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_url = wp_get_attachment_url( $attachment_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = str_replace( basename( $parent_url ), basename( $cropped ), $parent_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $size = @getimagesize( $cropped );
</span><span class="cx" style="display: block; padding: 0 10px"> $image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $object = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_title' => basename( $cropped ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_title' => wp_basename( $cropped ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'post_content' => $url,
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_mime_type' => $image_type,
</span><span class="cx" style="display: block; padding: 0 10px"> 'guid' => $url,
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpsiteiconphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-site-icon.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-site-icon.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-admin/includes/class-wp-site-icon.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,7 +85,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function create_attachment_object( $cropped, $parent_attachment_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $parent = get_post( $parent_attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_url = wp_get_attachment_url( $parent->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = str_replace( basename( $parent_url ), basename( $cropped ), $parent_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $size = @getimagesize( $cropped );
</span><span class="cx" style="display: block; padding: 0 10px"> $image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,7 +92,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $object = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'ID' => $parent_attachment_id,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_title' => basename( $cropped ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_title' => wp_basename( $cropped ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'post_content' => $url,
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_mime_type' => $image_type,
</span><span class="cx" style="display: block; padding: 0 10px"> 'guid' => $url,
</span></span></pre></div>
<a id="trunksrcwpadminincludesimageeditphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/image-edit.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/image-edit.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-admin/includes/image-edit.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $can_restore = false;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $backup_sizes ) && isset( $backup_sizes['full-orig'], $meta['file'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $can_restore = $backup_sizes['full-orig']['file'] != basename( $meta['file'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $can_restore = $backup_sizes['full-orig']['file'] != wp_basename( $meta['file'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $msg ) {
</span></span></pre></div>
<a id="trunksrcwpadminincludesimagephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/image.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/image.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-admin/includes/image.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,7 +47,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $dst_file ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $dst_file = str_replace( basename( $src_file ), 'cropped-' . basename( $src_file ), $src_file );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $dst_file = str_replace( wp_basename( $src_file ), 'cropped-' . wp_basename( $src_file ), $src_file );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,7 +56,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> wp_mkdir_p( dirname( $dst_file ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), basename( $dst_file ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), wp_basename( $dst_file ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $editor->save( $dst_file );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $result ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -189,7 +189,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ext = '.png';
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $basename = str_replace( '.', '-', basename( $file ) ) . '-image' . $ext;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $basename = str_replace( '.', '-', wp_basename( $file ) ) . '-image' . $ext;
</ins><span class="cx" style="display: block; padding: 0 10px"> $uploaded = wp_upload_bits( $basename, '', $metadata['image']['data'] );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false === $uploaded['error'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $image_attachment = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -711,8 +711,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $src_file ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $dst_file = str_replace( basename( $dst_file ), 'copy-' . basename( $dst_file ), $dst_file );
- $dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), basename( $dst_file ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $dst_file = str_replace( wp_basename( $dst_file ), 'copy-' . wp_basename( $dst_file ), $dst_file );
+ $dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), wp_basename( $dst_file ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * The directory containing the original file may no longer
</span></span></pre></div>
<a id="trunksrcwpadminincludesimportphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/import.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/import.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-admin/includes/import.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,7 +99,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Construct the object array
</span><span class="cx" style="display: block; padding: 0 10px"> $object = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_title' => basename( $upload['file'] ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_title' => wp_basename( $upload['file'] ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'post_content' => $upload['url'],
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_mime_type' => $upload['type'],
</span><span class="cx" style="display: block; padding: 0 10px"> 'guid' => $upload['url'],
</span></span></pre></div>
<a id="trunksrcwpadminincludesmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/media.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-admin/includes/media.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -434,7 +434,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = $file['url'];
</span><span class="cx" style="display: block; padding: 0 10px"> $type = $file['type'];
</span><span class="cx" style="display: block; padding: 0 10px"> $file = $file['file'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = preg_replace( '/\.[^.]+$/', '', basename( $file ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $title = preg_replace( '/\.[^.]+$/', '', wp_basename( $file ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $content = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Use image exif/iptc data for title and caption defaults if possible.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -826,7 +826,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_POST['media_type'] ) && 'image' != $_POST['media_type'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $title = esc_html( wp_unslash( $_POST['title'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $title ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = esc_html( basename( $src ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $title = esc_html( wp_basename( $src ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $title && $src ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -930,7 +930,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $file_array = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $file_array['name'] = basename( $matches[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $file_array['name'] = wp_basename( $matches[0] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Download file to temp location.
</span><span class="cx" style="display: block; padding: 0 10px"> $file_array['tmp_name'] = download_url( $file );
</span></span></pre></div>
<a id="trunksrcwpadminincludesmiscphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/misc.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/misc.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-admin/includes/misc.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -362,7 +362,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> aria-posinset="<?php echo esc_attr( $index ); ?>">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> $file_description = esc_html( get_file_description( $filename ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $file_description !== $filename && basename( $filename ) !== $file_description ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $file_description !== $filename && wp_basename( $filename ) !== $file_description ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $file_description .= '<br /><span class="nonessential">(' . esc_html( $filename ) . ')</span>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentytenloopattachmentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyten/loop-attachment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyten/loop-attachment.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-content/themes/twentyten/loop-attachment.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,7 +138,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="nav-next"><?php next_image_link( false ); ?></div>
</span><span class="cx" style="display: block; padding: 0 10px"> </div><!-- #nav-below -->
</span><span class="cx" style="display: block; padding: 0 10px"> <?php else : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <a href="<?php echo esc_url( wp_get_attachment_url() ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php echo esc_html( basename( get_permalink() ) ); ?></a>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <a href="<?php echo esc_url( wp_get_attachment_url() ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php echo esc_html( wp_basename( get_permalink() ) ); ?></a>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </div><!-- .entry-attachment -->
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="entry-caption">
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpcustomizemanagerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-customize-manager.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-customize-manager.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-includes/class-wp-customize-manager.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1360,7 +1360,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $attachment_id ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Copy file to temp location so that original file won't get deleted from theme after sideloading.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $temp_file_name = wp_tempnam( basename( $file_path ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $temp_file_name = wp_tempnam( wp_basename( $file_path ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $temp_file_name && copy( $file_path, $temp_file_name ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file_array['tmp_name'] = $temp_file_name;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1621,7 +1621,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $file_name = basename( $attachment['file'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $file_name = wp_basename( $attachment['file'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Skip file types that are not recognized.
</span><span class="cx" style="display: block; padding: 0 10px"> $checked_filetype = wp_check_filetype( $file_name );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4594,7 +4594,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->return_url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $return_url = $this->return_url;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( $referer && ! in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( $referer && ! in_array( wp_basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $return_url = $referer;
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $this->preview_url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $return_url = $this->preview_url;
</span></span></pre></div>
<a id="trunksrcwpincludescustomizeclasswpcustomizemediacontrolphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/customize/class-wp-customize-media-control.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/customize/class-wp-customize-media-control.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-includes/customize/class-wp-customize-media-control.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,7 +92,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'url' => $this->setting->default,
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => $type,
</span><span class="cx" style="display: block; padding: 0 10px"> 'icon' => wp_mime_type_icon( $type ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'title' => basename( $this->setting->default ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'title' => wp_basename( $this->setting->default ),
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'image' === $type ) {
</span></span></pre></div>
<a id="trunksrcwpincludesdeprecatedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/deprecated.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-includes/deprecated.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1878,7 +1878,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // We have a thumbnail desired, specified and existing
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $src_file = basename($src);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $src_file = wp_basename($src);
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( wp_attachment_is_image( $post->ID ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // We have an image without a thumbnail
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1888,7 +1888,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // No thumb, no image. We'll look for a mime-related icon instead.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $src_file = $icon_dir . '/' . basename($src);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $src_file = $icon_dir . '/' . wp_basename($src);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !isset($src) || !$src )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3058,7 +3058,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_theme_data( $theme_file ) {
</span><span class="cx" style="display: block; padding: 0 10px"> _deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $theme = new WP_Theme( basename( dirname( $theme_file ) ), dirname( dirname( $theme_file ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $theme = new WP_Theme( wp_basename( dirname( $theme_file ) ), dirname( dirname( $theme_file ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_data = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'Name' => $theme->get('Name'),
</span></span></pre></div>
<a id="trunksrcwpincludesfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/functions.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-includes/functions.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2096,7 +2096,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 0 === strpos( $uploads['basedir'], ABSPATH ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir'];
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $error_path = basename( $uploads['basedir'] ) . $uploads['subdir'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $error_path = wp_basename( $uploads['basedir'] ) . $uploads['subdir'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $uploads['error'] = sprintf(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2381,7 +2381,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 0 === strpos( $upload['basedir'], ABSPATH ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $error_path = str_replace( ABSPATH, '', $upload['basedir'] ) . $upload['subdir'];
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $error_path = basename( $upload['basedir'] ) . $upload['subdir'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $error_path = wp_basename( $upload['basedir'] ) . $upload['subdir'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $message = sprintf(
</span></span></pre></div>
<a id="trunksrcwpincludesmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/media.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-includes/media.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2871,7 +2871,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $file = get_attached_file( $attachment->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $filename = basename( $file );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $filename = wp_basename( $file );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $objects = array( 'attachment' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludespostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/post.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-includes/post.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5474,7 +5474,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $meta['thumb'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Don't delete the thumb if another attachment uses it.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d", '%' . $wpdb->esc_like( $meta['thumb'] ) . '%', $post_id ) ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $thumbfile = str_replace( basename( $file ), $meta['thumb'], $file );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $thumbfile = str_replace( wp_basename( $file ), $meta['thumb'], $file );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $thumbfile ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbfile = path_join( $uploadpath['basedir'], $thumbfile );
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbdir = path_join( $uploadpath['basedir'], dirname( $file ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5490,7 +5490,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $meta['sizes'] ) && is_array( $meta['sizes'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $intermediate_dir = path_join( $uploadpath['basedir'], dirname( $file ) );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $meta['sizes'] as $size => $sizeinfo ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $intermediate_file = str_replace( basename( $file ), $sizeinfo['file'], $file );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $intermediate_file = str_replace( wp_basename( $file ), $sizeinfo['file'], $file );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $intermediate_file ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $intermediate_file = path_join( $uploadpath['basedir'], $intermediate_file );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5616,7 +5616,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = str_replace( $uploads['basedir'], $uploads['baseurl'], $file );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( false !== strpos( $file, 'wp-content/uploads' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Get the directory name relative to the basedir (back compat for pre-2.7 uploads)
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = trailingslashit( $uploads['baseurl'] . '/' . _wp_get_attachment_relative_path( $file ) ) . basename( $file );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = trailingslashit( $uploads['baseurl'] . '/' . _wp_get_attachment_relative_path( $file ) ) . wp_basename( $file );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> // It's a newly-uploaded file, therefore $file is relative to the basedir.
</span><span class="cx" style="display: block; padding: 0 10px"> $url = $uploads['baseurl'] . "/$file";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5704,7 +5704,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $file = get_attached_file( $post->ID );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $imagedata['thumb'] ) && ( $thumbfile = str_replace( basename( $file ), $imagedata['thumb'], $file ) ) && file_exists( $thumbfile ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $imagedata['thumb'] ) && ( $thumbfile = str_replace( wp_basename( $file ), $imagedata['thumb'], $file ) ) && file_exists( $thumbfile ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the attachment thumbnail file path.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5744,7 +5744,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = str_replace( basename( $url ), basename( $thumb ), $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = str_replace( wp_basename( $url ), wp_basename( $thumb ), $url );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the attachment thumbnail URL.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5896,7 +5896,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $uri = array_shift( $dirs );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $dh = opendir( $dir ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> while ( false !== $file = readdir( $dh ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $file = basename( $file );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $file = wp_basename( $file );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( substr( $file, 0, 1 ) == '.' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5915,9 +5915,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $types = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Icon basename - extension = MIME wildcard.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Icon wp_basename - extension = MIME wildcard.
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $icon_files as $file => $uri ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $types[ preg_replace( '/^([^.]*).*$/', '$1', basename( $file ) ) ] =& $icon_files[ $file ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $types[ preg_replace( '/^([^.]*).*$/', '$1', wp_basename( $file ) ) ] =& $icon_files[ $file ];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $mime ) ) {
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestattachmentscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -114,7 +114,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $file;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $name = basename( $file['file'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $name = wp_basename( $file['file'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $name_parts = pathinfo( $name );
</span><span class="cx" style="display: block; padding: 0 10px"> $name = trim( substr( $name, 0, -( 1 + strlen( $name_parts['extension'] ) ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,7 +143,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment->guid = $url;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $attachment->post_title ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $attachment->post_title = preg_replace( '/\.[^.]+$/', '', basename( $file ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $attachment->post_title = preg_replace( '/\.[^.]+$/', '', wp_basename( $file ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // $post_parent is inherited from $attachment['post_parent'].
</span></span></pre></div>
<a id="trunktestsphpunitincludesabstracttestcasephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/includes/abstract-testcase.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/includes/abstract-testcase.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/includes/abstract-testcase.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1062,7 +1062,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_title' => basename( $upload['file'] ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_title' => wp_basename( $upload['file'] ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'post_content' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_type' => 'attachment',
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_parent' => $parent_post_id,
</span></span></pre></div>
<a id="trunktestsphpunitincludesfactoryclasswpunittestfactoryforattachmentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-attachment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-attachment.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-attachment.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,7 +46,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function create_upload_object( $file, $parent = 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $file );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $file ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $file ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $type = '';
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $upload['type'] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_title' => basename( $upload['file'] ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_title' => wp_basename( $upload['file'] ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'post_content' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_type' => 'attachment',
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_parent' => $parent,
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxAttachmentsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/ajax/Attachments.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/Attachments.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/tests/ajax/Attachments.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,7 +29,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = DIR_TESTDATA . '/images/canola.jpg';
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $attachment = $this->_make_attachment( $upload );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set up a default request
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -80,7 +80,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = DIR_TESTDATA . '/formatting/entities.txt';
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $attachment = $this->_make_attachment( $upload );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set up a default request
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxMediaEditphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/ajax/MediaEdit.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/MediaEdit.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/tests/ajax/MediaEdit.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = DIR_TESTDATA . '/images/canola.jpg';
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $id = $this->_make_attachment( $upload );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_REQUEST['action'] = 'image-editor';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,7 +63,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = DIR_TESTDATA . '/images/canola.jpg';
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $id = $this->_make_attachment( $upload );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_REQUEST['action'] = 'image-editor';
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksblockparserphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/blocks/block-parser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/block-parser.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/tests/blocks/block-parser.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,7 +85,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string The cleaned fixture name.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function clean_fixture_filename( $filename ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $filename = basename( $filename );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $filename = wp_basename( $filename );
</ins><span class="cx" style="display: block; padding: 0 10px"> $filename = preg_replace( '/\..+$/', '', $filename );
</span><span class="cx" style="display: block; padding: 0 10px"> return $filename;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksrenderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/blocks/render.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/render.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/tests/blocks/render.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -358,7 +358,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string The cleaned fixture name.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function clean_fixture_filename( $filename ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $filename = basename( $filename );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $filename = wp_basename( $filename );
</ins><span class="cx" style="display: block; padding: 0 10px"> $filename = preg_replace( '/\..+$/', '', $filename );
</span><span class="cx" style="display: block; padding: 0 10px"> return $filename;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsgeneraltemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/general/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/general/template.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/tests/general/template.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -231,7 +231,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = DIR_TESTDATA . '/images/test-image.jpg';
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->site_icon_url = $upload['url'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Save the data
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -409,7 +409,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function _insert_custom_logo() {
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = DIR_TESTDATA . '/images/test-image.jpg';
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Save the data.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->custom_logo_url = $upload['url'];
</span></span></pre></div>
<a id="trunktestsphpunittestsimageeditorphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/image/editor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/editor.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/tests/image/editor.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,16 +130,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with no parameters
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'canola-100x50.jpg', basename( $editor->generate_filename() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( 'canola-100x50.jpg', wp_basename( $editor->generate_filename() ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with a suffix only
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'canola-new.jpg', basename( $editor->generate_filename( 'new' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( 'canola-new.jpg', wp_basename( $editor->generate_filename( 'new' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with a destination dir only
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( trailingslashit( realpath( get_temp_dir() ) ), trailingslashit( realpath( dirname( $editor->generate_filename( null, get_temp_dir() ) ) ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with a suffix only
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'canola-100x50.png', basename( $editor->generate_filename( null, null, 'png' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( 'canola-100x50.png', wp_basename( $editor->generate_filename( null, null, 'png' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Combo!
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( trailingslashit( realpath( get_temp_dir() ) ) . 'canola-new.png', $editor->generate_filename( 'new', realpath( get_temp_dir() ), 'png' ) );
</span></span></pre></div>
<a id="trunktestsphpunittestsimageintermediateSizephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/image/intermediateSize.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/intermediateSize.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/tests/image/intermediateSize.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function _make_attachment( $file, $parent_post_id = 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $file );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $file ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $file ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return parent::_make_attachment( $upload, $parent_post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsimageresizephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/image/resize.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/resize.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/tests/image/resize.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,7 +29,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_jpg() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/test-image.jpg', 25, 25 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-image-25x25.jpg', basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( 'test-image-25x25.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 25, $w );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 25, $h );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->fail( sprintf( 'No PNG support in the editor engine %s on this system', $this->editor_engine ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-image-25x25.png', basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( 'test-image-25x25.png', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 25, $w );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 25, $h );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,7 +61,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->fail( sprintf( 'No GIF support in the editor engine %s on this system', $this->editor_engine ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-image-25x25.gif', basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( 'test-image-25x25.gif', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 25, $w );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 25, $h );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,7 +81,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_thumb_128x96() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 96 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-64x96.jpg', basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( '2007-06-17DSC_4173-64x96.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 64, $w );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 96, $h );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,7 +93,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_thumb_128x0() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-128x193.jpg', basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( '2007-06-17DSC_4173-128x193.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 128, $w );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 193, $h );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,7 +105,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_thumb_0x96() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 0, 96 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-64x96.jpg', basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( '2007-06-17DSC_4173-64x96.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 64, $w );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 96, $h );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,7 +117,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_thumb_150x150_crop() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 150, 150, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 150, $w );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 150, $h );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,7 +129,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_thumb_150x100_crop() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 150, 100, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-150x100.jpg', basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( '2007-06-17DSC_4173-150x100.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 150, $w );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 100, $h );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,7 +141,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_thumb_50x150_crop() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 50, 150, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-50x150.jpg', basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( '2007-06-17DSC_4173-50x150.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 50, $w );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 150, $h );
</span></span></pre></div>
<a id="trunktestsphpunittestsimagesiteIconphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/image/siteIcon.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/siteIcon.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/tests/image/siteIcon.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -101,7 +101,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_create_attachment_object() {
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = $this->_insert_attachment();
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_url = get_post( $attachment_id )->guid;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $cropped = str_replace( basename( $parent_url ), 'cropped-test-image.jpg', $parent_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $cropped = str_replace( wp_basename( $parent_url ), 'cropped-test-image.jpg', $parent_url );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $object = $this->wp_site_icon->create_attachment_object( $cropped, $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,7 +115,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_insert_cropped_attachment() {
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = $this->_insert_attachment();
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_url = get_post( $attachment_id )->guid;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $cropped = str_replace( basename( $parent_url ), 'cropped-test-image.jpg', $parent_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $cropped = str_replace( wp_basename( $parent_url ), 'cropped-test-image.jpg', $parent_url );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $object = $this->wp_site_icon->create_attachment_object( $cropped, $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $cropped_id = $this->wp_site_icon->insert_attachment( $object, $cropped );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -163,7 +163,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = DIR_TESTDATA . '/images/test-image.jpg';
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->attachment_id = $this->_make_attachment( $upload );
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->attachment_id;
</span></span></pre></div>
<a id="trunktestsphpunittestsmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/media.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/tests/media.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1524,7 +1524,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Copy hash generation method used in wp_save_image().
</span><span class="cx" style="display: block; padding: 0 10px"> $hash = 'e' . time() . rand( 100, 999 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $filename_base = basename( $image_meta['file'], '.png' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $filename_base = wp_basename( $image_meta['file'], '.png' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add the hash to the image URL
</span><span class="cx" style="display: block; padding: 0 10px"> $image_url = str_replace( $filename_base, $filename_base . '-' . $hash, $image_url );
</span></span></pre></div>
<a id="trunktestsphpunittestspostattachmentsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/post/attachments.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/attachments.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/tests/post/attachments.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/test-image.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $upload['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id = $this->_make_attachment( $upload );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,17 +39,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // medium, medium_large, and full size will both point to the original
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'medium' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( basename( $upload['file'] ), basename( $downsize[0] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( wp_basename( $upload['file'] ), wp_basename( $downsize[0] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 50, $downsize[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 50, $downsize[2] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'medium_large' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( basename( $upload['file'] ), basename( $downsize[0] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( wp_basename( $upload['file'] ), wp_basename( $downsize[0] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 50, $downsize[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 50, $downsize[2] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'full' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( basename( $upload['file'] ), basename( $downsize[0] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( wp_basename( $upload['file'] ), wp_basename( $downsize[0] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 50, $downsize[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 50, $downsize[2] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,7 +66,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/a2-small.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $upload['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id = $this->_make_attachment( $upload );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,23 +86,23 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // image_downsize() should return the correct images and sizes
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'thumbnail' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a2-small-150x150.jpg', basename( $downsize[0] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( 'a2-small-150x150.jpg', wp_basename( $downsize[0] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 150, $downsize[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 150, $downsize[2] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // medium, medium_large, and full will both point to the original
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'medium' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a2-small.jpg', basename( $downsize[0] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( 'a2-small.jpg', wp_basename( $downsize[0] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 400, $downsize[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 300, $downsize[2] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'medium_large' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a2-small.jpg', basename( $downsize[0] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( 'a2-small.jpg', wp_basename( $downsize[0] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 400, $downsize[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 300, $downsize[2] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'full' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a2-small.jpg', basename( $downsize[0] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( 'a2-small.jpg', wp_basename( $downsize[0] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 400, $downsize[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 300, $downsize[2] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,7 +122,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG' );
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $upload['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id = $this->_make_attachment( $upload );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,22 +146,22 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // image_downsize() should return the correct images and sizes
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'thumbnail' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', basename( $downsize[0] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', wp_basename( $downsize[0] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 150, $downsize[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 150, $downsize[2] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'medium' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-400x602.jpg', basename( $downsize[0] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( '2007-06-17DSC_4173-400x602.jpg', wp_basename( $downsize[0] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 400, $downsize[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 602, $downsize[2] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'medium_large' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-600x904.jpg', basename( $downsize[0] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( '2007-06-17DSC_4173-600x904.jpg', wp_basename( $downsize[0] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 600, $downsize[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 904, $downsize[2] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'full' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173.jpg', basename( $downsize[0] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( '2007-06-17DSC_4173.jpg', wp_basename( $downsize[0] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 680, $downsize[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1024, $downsize[2] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,7 +181,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG' );
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $upload['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id = $this->_make_attachment( $upload );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -224,7 +224,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/test-image.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $upload['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $upload['url'] = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -241,7 +241,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/test-image.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $upload['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id = $this->_make_attachment( $upload );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -267,7 +267,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/test-image.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $upload['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = $this->_make_attachment( $upload );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -299,7 +299,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = DIR_TESTDATA . '/images/test-image.jpg';
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $upload['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set attachment ID.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -324,7 +324,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = DIR_TESTDATA . '/images/test-image.jpg';
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $upload['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set attachment ID.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -349,7 +349,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/test-image.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $upload['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set attachment ID
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -377,7 +377,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/test-image.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $upload['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set attachment ID.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -405,7 +405,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/test-image.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $upload['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set attachment ID
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -432,7 +432,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/test-image.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $upload['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set attachment ID
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -454,7 +454,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = DIR_TESTDATA . '/images/test-image.jpg';
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = $this->_make_attachment( $upload );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_attachment_is_image( $attachment_id ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -472,7 +472,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = DIR_TESTDATA . '/images/test-image.psd';
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = $this->_make_attachment( $upload );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_attachment_is_image( $attachment_id ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -489,13 +489,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = DIR_TESTDATA . '/images/test-image.jpg';
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $upload['error'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'upload_mimes', array( $this, 'blacklist_jpg_mime_type' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'upload_mimes', array( $this, 'blacklist_jpg_mime_type' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestattachmentscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1435,7 +1435,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $filename = basename( $this->test_file2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $filename = wp_basename( $this->test_file2 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/media' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'search', $filename );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetMediaItemphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php 2019-02-28 22:57:47 UTC (rev 44784)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php 2019-03-01 20:57:26 UTC (rev 44785)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/waffles.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = file_get_contents( $filename );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload = wp_upload_bits( basename( $filename ), null, $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->attachment_id = $this->_make_attachment( $upload, self::$post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->attachment_data = get_post( $this->attachment_id, ARRAY_A );
</span></span></pre>
</div>
</div>
</body>
</html>