<!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>[50700] trunk/src/wp-admin/includes/file.php: Coding Standards: Use strict comparison in `wp-admin/includes/file.php`.</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/50700">50700</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/50700","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2021-04-12 18:17:37 +0000 (Mon, 12 Apr 2021)</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'>Coding Standards: Use strict comparison in `wp-admin/includes/file.php`.
Includes minor code layout fixes for better readability.
See <a href="https://core.trac.wordpress.org/ticket/52627">#52627</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesfilephp">trunk/src/wp-admin/includes/file.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesfilephp"></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/file.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/file.php 2021-04-11 13:42:25 UTC (rev 50699)
+++ trunk/src/wp-admin/includes/file.php 2021-04-12 18:17:37 UTC (rev 50700)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,6 +146,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $files = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $dir = @opendir( $folder );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $dir ) {
</span><span class="cx" style="display: block; padding: 0 10px"> while ( ( $file = readdir( $dir ) ) !== false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Skip current and parent folder links.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -369,8 +370,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $args['file'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'missing_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">- $file = $args['file'];
- if ( 0 !== validate_file( $file ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( 0 !== validate_file( $args['file'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'bad_file' );
</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">@@ -377,15 +378,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $args['newcontent'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'missing_content' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $content = $args['newcontent'];
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $args['nonce'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'missing_nonce' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $file = $args['file'];
+ $content = $args['newcontent'];
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $plugin = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $real_file = null;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $args['plugin'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $plugin = $args['plugin'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -417,6 +421,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! empty( $args['theme'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $stylesheet = $args['theme'];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 0 !== validate_file( $stylesheet ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'bad_theme_path' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -494,6 +499,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"> $f = fopen( $real_file, 'w+' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false === $f ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'file_not_writable' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -500,6 +506,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $written = fwrite( $f, $content );
</span><span class="cx" style="display: block; padding: 0 10px"> fclose( $f );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false === $written ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'unable_to_write', __( 'Unable to write to file.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -575,6 +582,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"> $result = null;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false === $scrape_result_position ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $loopback_request_failure;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -609,7 +617,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> delete_transient( $transient );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( true !== $result ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> // Roll-back file change.
</span><span class="cx" style="display: block; padding: 0 10px"> file_put_contents( $real_file, $previous_content );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_opcache_invalidate( $real_file, true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -620,6 +627,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $message = $result['message'];
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $result['message'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'php_error', $message, $result );
</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">@@ -671,9 +679,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $temp_filename = $dir . wp_unique_filename( $dir, $temp_filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $fp = @fopen( $temp_filename, 'x' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $fp && is_writable( $dir ) && file_exists( $temp_filename ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return wp_tempnam( $filename, $dir );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $fp ) {
</span><span class="cx" style="display: block; padding: 0 10px"> fclose( $fp );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -846,9 +856,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $mimes = isset( $overrides['mimes'] ) ? $overrides['mimes'] : false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // A correct form post will pass this test.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $test_form && ( ! isset( $_POST['action'] ) || ( $_POST['action'] != $action ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $test_form && ( ! isset( $_POST['action'] ) || $_POST['action'] !== $action ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return call_user_func_array( $upload_error_handler, array( &$file, __( 'Invalid form submission.' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> // A successful upload will pass this test. It makes no sense to override this one.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $file['error'] ) && $file['error'] > 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return call_user_func_array( $upload_error_handler, array( &$file, $upload_error_strings[ $file['error'] ] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -874,6 +885,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'upload_max_filesize'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return call_user_func_array( $upload_error_handler, array( &$file, $error_msg ) );
</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">@@ -888,9 +900,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $proper_filename ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file['name'] = $proper_filename;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ( ! $type || ! $ext ) && ! current_user_can( 'unfiltered_upload' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return call_user_func_array( $upload_error_handler, array( &$file, __( 'Sorry, this file type is not permitted for security reasons.' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $type = $file['type'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -943,6 +957,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $error_path = basename( $uploads['basedir'] ) . $uploads['subdir'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $upload_error_handler(
</span><span class="cx" style="display: block; padding: 0 10px"> $file,
</span><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1078,7 +1093,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $tmpfname = wp_tempnam( $url_filename );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $tmpfname ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'http_no_file', __( 'Could not create Temporary file.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error( 'http_no_file', __( 'Could not create temporary 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"> $response = wp_safe_remote_get(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1097,7 +1112,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response_code = wp_remote_retrieve_response_code( $response );
</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 ( 200 != $response_code ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 200 !== $response_code ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => $response_code,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1104,6 +1119,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Retrieve a sample of the response body for debugging purposes.
</span><span class="cx" style="display: block; padding: 0 10px"> $tmpf = fopen( $tmpfname, 'rb' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $tmpf ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the maximum error response body size in `download_url()`.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1115,17 +1131,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $size The maximum error response body size. Default 1 KB.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $response_size = apply_filters( 'download_url_error_max_body_size', KB_IN_BYTES );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $data['body'] = fread( $tmpf, $response_size );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $data['body'] = fread( $tmpf, $response_size );
</ins><span class="cx" style="display: block; padding: 0 10px"> fclose( $tmpf );
</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"> unlink( $tmpfname );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'http_404', trim( wp_remote_retrieve_response_message( $response ) ), $data );
</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"> $content_md5 = wp_remote_retrieve_header( $response, 'content-md5' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $content_md5 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $md5_check = verify_file_md5( $tmpfname, $content_md5 );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $md5_check ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $tmpfname );
</span><span class="cx" style="display: block; padding: 0 10px"> return $md5_check;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1141,7 +1161,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string[] $hostnames List of hostnames.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $signed_hostnames = apply_filters( 'wp_signature_hosts', array( 'wordpress.org', 'downloads.wordpress.org', 's.w.org' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $signed_hostnames = apply_filters( 'wp_signature_hosts', array( 'wordpress.org', 'downloads.wordpress.org', 's.w.org' ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $signature_verification = in_array( parse_url( $url, PHP_URL_HOST ), $signed_hostnames, true );
</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">@@ -1148,6 +1169,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Perform signature valiation if supported.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $signature_verification ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $signature = wp_remote_retrieve_header( $response, 'x-content-signature' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $signature ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Retrieve signatures from a file if the header wasn't included.
</span><span class="cx" style="display: block; padding: 0 10px"> // WordPress.org stores signatures at $package_url.sig.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1225,9 +1247,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * WP_Error on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function verify_file_md5( $filename, $expected_md5 ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 32 == strlen( $expected_md5 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 32 === strlen( $expected_md5 ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected_raw_md5 = pack( 'H*', $expected_md5 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( 24 == strlen( $expected_md5 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( 24 === strlen( $expected_md5 ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected_raw_md5 = base64_decode( $expected_md5 );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return false; // Unknown format.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1287,7 +1309,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Sodium_Compat isn't compatible with PHP 7.2.0~7.2.2 due to a bug in the PHP Opcache extension, bail early as it'll fail.
</span><span class="cx" style="display: block; padding: 0 10px"> // https://bugs.php.net/bug.php?id=75938
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error(
</span><span class="cx" style="display: block; padding: 0 10px"> 'signature_verification_unsupported',
</span><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1301,7 +1322,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'sodium' => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : 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">-
</del><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"> // Verify runtime speed of Sodium_Compat is acceptable.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1536,6 +1556,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $z = new ZipArchive();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $zopen = $z->open( $file, ZIPARCHIVE::CHECKCONS );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( true !== $zopen ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'incompatible_archive', __( 'Incompatible Archive.' ), array( 'ziparchive_error' => $zopen ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1544,6 +1565,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> for ( $i = 0; $i < $z->numFiles; $i++ ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $info = $z->statIndex( $i );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $info ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'stat_failed_ziparchive', __( 'Could not retrieve file from archive.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1577,27 +1599,39 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> if ( wp_doing_cron() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $available_space = @disk_free_space( WP_CONTENT_DIR );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error(
+ 'disk_full_unzip_file',
+ __( 'Could not copy files. You may have run out of disk space.' ),
+ compact( 'uncompressed_size', 'available_space' )
+ );
</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="cx" style="display: block; padding: 0 10px"> $needed_dirs = array_unique( $needed_dirs );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $needed_dirs as $dir ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the parent folders of the folders all exist within the creation array.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( untrailingslashit( $to ) == $dir ) { // Skip over the working directory, we know this exists (or will exist).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( untrailingslashit( $to ) === $dir ) { // Skip over the working directory, we know this exists (or will exist).
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( strpos( $dir, $to ) === false ) { // If the directory is not within the working directory, skip it.
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</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"> $parent_folder = dirname( $dir );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- while ( ! empty( $parent_folder ) && untrailingslashit( $to ) != $parent_folder && ! in_array( $parent_folder, $needed_dirs, true ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ while ( ! empty( $parent_folder )
+ && untrailingslashit( $to ) !== $parent_folder
+ && ! in_array( $parent_folder, $needed_dirs, true )
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $needed_dirs[] = $parent_folder;
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_folder = dirname( $parent_folder );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> asort( $needed_dirs );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Create those directories if need be:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1611,6 +1645,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> for ( $i = 0; $i < $z->numFiles; $i++ ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $info = $z->statIndex( $i );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $info ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'stat_failed_ziparchive', __( 'Could not retrieve file from archive.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1629,6 +1664,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"> $contents = $z->getFromIndex( $i );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false === $contents ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'extract_failed_ziparchive', __( 'Could not extract file from archive.' ), $info['name'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1704,27 +1740,39 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> if ( wp_doing_cron() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $available_space = @disk_free_space( WP_CONTENT_DIR );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error(
+ 'disk_full_unzip_file',
+ __( 'Could not copy files. You may have run out of disk space.' ),
+ compact( 'uncompressed_size', 'available_space' )
+ );
</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="cx" style="display: block; padding: 0 10px"> $needed_dirs = array_unique( $needed_dirs );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $needed_dirs as $dir ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the parent folders of the folders all exist within the creation array.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( untrailingslashit( $to ) == $dir ) { // Skip over the working directory, we know this exists (or will exist).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( untrailingslashit( $to ) === $dir ) { // Skip over the working directory, we know this exists (or will exist).
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( strpos( $dir, $to ) === false ) { // If the directory is not within the working directory, skip it.
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</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"> $parent_folder = dirname( $dir );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- while ( ! empty( $parent_folder ) && untrailingslashit( $to ) != $parent_folder && ! in_array( $parent_folder, $needed_dirs, true ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ while ( ! empty( $parent_folder )
+ && untrailingslashit( $to ) !== $parent_folder
+ && ! in_array( $parent_folder, $needed_dirs, true )
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $needed_dirs[] = $parent_folder;
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_folder = dirname( $parent_folder );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> asort( $needed_dirs );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Create those directories if need be:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1755,6 +1803,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $file['filename'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</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">@@ -1794,6 +1843,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // If copy failed, chmod file to 0644 and try again.
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_filesystem->chmod( $to . $filename, FS_CHMOD_FILE );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'copy_failed_copy_dir', __( 'Could not copy file.' ), $to . $filename );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1809,6 +1859,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Generate the $sub_skip_list for the subdirectory as a sub-set of the existing $skip_list.
</span><span class="cx" style="display: block; padding: 0 10px"> $sub_skip_list = array();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $skip_list as $skip_item ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 0 === strpos( $skip_item, $filename . '/' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $sub_skip_list[] = preg_replace( '!^' . preg_quote( $filename, '!' ) . '/!i', '', $skip_item );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1816,6 +1867,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"> $result = copy_dir( $from . $filename, $to . $filename, $sub_skip_list );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $result ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $result;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1947,7 +1999,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 the directory doesn't exist (wp-content/languages) then use the parent directory as we'll create it.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( WP_LANG_DIR == $context && ! is_dir( $context ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( WP_LANG_DIR === $context && ! is_dir( $context ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $context = dirname( $context );
</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">@@ -2068,6 +2120,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $allow_relaxed_file_ownership Whether to allow Group/World writable.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $req_cred = apply_filters( 'request_filesystem_credentials', '', $form_post, $type, $error, $context, $extra_fields, $allow_relaxed_file_ownership );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( '' !== $req_cred ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $req_cred;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2136,9 +2189,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! isset( $credentials['connection_type'] ) ) { // All else fails (and it's not defaulted to something else saved), default to FTP.
</span><span class="cx" style="display: block; padding: 0 10px"> $credentials['connection_type'] = 'ftp';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $error
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- && ( ( ! empty( $credentials['password'] ) && ! empty( $credentials['username'] ) && ! empty( $credentials['hostname'] ) )
- || ( 'ssh' === $credentials['connection_type'] && ! empty( $credentials['public_key'] ) && ! empty( $credentials['private_key'] ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ && ( ! empty( $credentials['hostname'] ) && ! empty( $credentials['username'] ) && ! empty( $credentials['password'] )
+ || 'ssh' === $credentials['connection_type'] && ! empty( $credentials['public_key'] ) && ! empty( $credentials['private_key'] )
</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"> $stored_credentials = $credentials;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2147,7 +2201,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $stored_credentials['hostname'] .= ':' . $stored_credentials['port'];
</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">- unset( $stored_credentials['password'], $stored_credentials['port'], $stored_credentials['private_key'], $stored_credentials['public_key'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ unset(
+ $stored_credentials['password'],
+ $stored_credentials['port'],
+ $stored_credentials['private_key'],
+ $stored_credentials['public_key']
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! wp_installing() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'ftp_credentials', $stored_credentials );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2155,6 +2214,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $credentials;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $hostname = isset( $credentials['hostname'] ) ? $credentials['hostname'] : '';
</span><span class="cx" style="display: block; padding: 0 10px"> $username = isset( $credentials['username'] ) ? $credentials['username'] : '';
</span><span class="cx" style="display: block; padding: 0 10px"> $public_key = isset( $credentials['public_key'] ) ? $credentials['public_key'] : '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2195,7 +2255,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $context Full path to the directory that is tested for being writable.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $types = apply_filters( 'fs_ftp_connection_types', $types, $credentials, $type, $error, $context );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <form action="<?php echo esc_url( $form_post ); ?>" method="post">
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="request-filesystem-credentials-form" class="request-filesystem-credentials-form">
</span></span></pre>
</div>
</div>
</body>
</html>