Changeset 43571 for trunk/src/wp-admin/includes/file.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r43569 r43571 891 891 */ 892 892 return apply_filters( 893 'wp_handle_upload', array( 893 'wp_handle_upload', 894 array( 894 895 'file' => $new_file, 895 896 'url' => $url, 896 897 'type' => $type, 897 ), 'wp_handle_sideload' === $action ? 'sideload' : 'upload' 898 ), 899 'wp_handle_sideload' === $action ? 'sideload' : 'upload' 898 900 ); 899 901 } … … 983 985 984 986 $response = wp_safe_remote_get( 985 $url, array( 987 $url, 988 array( 986 989 'timeout' => $timeout, 987 990 'stream' => true, … … 1680 1683 1681 1684 $credentials = get_option( 1682 'ftp_credentials', array( 1685 'ftp_credentials', 1686 array( 1683 1687 'hostname' => '', 1684 1688 'username' => '', … … 1787 1791 $types = apply_filters( 'fs_ftp_connection_types', $types, $credentials, $type, $error, $context ); 1788 1792 1789 ?>1793 ?> 1790 1794 <form action="<?php echo esc_url( $form_post ); ?>" method="post"> 1791 1795 <div id="request-filesystem-credentials-form" class="request-filesystem-credentials-form"> 1792 <?php1793 // Print a H1 heading in the FTP credentials modal dialog, default is a H2.1794 $heading_tag = 'h2';1795 if ( 'plugins.php' === $pagenow || 'plugin-install.php' === $pagenow ) {1796 $heading_tag = 'h1';1797 }1798 echo "<$heading_tag id='request-filesystem-credentials-title'>" . __( 'Connection Information' ) . "</$heading_tag>";1799 ?>1796 <?php 1797 // Print a H1 heading in the FTP credentials modal dialog, default is a H2. 1798 $heading_tag = 'h2'; 1799 if ( 'plugins.php' === $pagenow || 'plugin-install.php' === $pagenow ) { 1800 $heading_tag = 'h1'; 1801 } 1802 echo "<$heading_tag id='request-filesystem-credentials-title'>" . __( 'Connection Information' ) . "</$heading_tag>"; 1803 ?> 1800 1804 <p id="request-filesystem-credentials-desc"> 1801 <?php1805 <?php 1802 1806 $label_user = __( 'Username' ); 1803 1807 $label_pass = __( 'Password' ); 1804 1808 _e( 'To perform the requested action, WordPress needs to access your web server.' ); 1805 1809 echo ' '; 1806 if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) {1807 if ( isset( $types['ssh'] ) ) {1808 _e( 'Please enter your FTP or SSH credentials to proceed.' );1809 $label_user = __( 'FTP/SSH Username' );1810 $label_pass = __( 'FTP/SSH Password' );1811 } else {1812 _e( 'Please enter your FTP credentials to proceed.' );1813 $label_user = __( 'FTP Username' );1814 $label_pass = __( 'FTP Password' );1815 }1816 echo ' ';1817 }1810 if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) { 1811 if ( isset( $types['ssh'] ) ) { 1812 _e( 'Please enter your FTP or SSH credentials to proceed.' ); 1813 $label_user = __( 'FTP/SSH Username' ); 1814 $label_pass = __( 'FTP/SSH Password' ); 1815 } else { 1816 _e( 'Please enter your FTP credentials to proceed.' ); 1817 $label_user = __( 'FTP Username' ); 1818 $label_pass = __( 'FTP Password' ); 1819 } 1820 echo ' '; 1821 } 1818 1822 _e( 'If you do not remember your credentials, you should contact your web host.' ); 1819 1823 … … 1827 1831 $password_value = '*****'; 1828 1832 } 1829 ?>1833 ?> 1830 1834 </p> 1831 1835 <label for="hostname"> … … 1847 1851 if ( ! defined( 'FTP_PASS' ) ) { 1848 1852 _e( 'This password will not be stored on the server.' );} 1849 ?>1853 ?> 1850 1854 </em> 1851 1855 </label> … … 1853 1857 <fieldset> 1854 1858 <legend><?php _e( 'Connection Type' ); ?></legend> 1855 <?php1859 <?php 1856 1860 $disabled = disabled( ( defined( 'FTP_SSL' ) && FTP_SSL ) || ( defined( 'FTP_SSH' ) && FTP_SSH ), true, false ); 1857 foreach ( $types as $name => $text ) :1858 ?>1861 foreach ( $types as $name => $text ) : 1862 ?> 1859 1863 <label for="<?php echo esc_attr( $name ); ?>"> 1860 1864 <input type="radio" name="connection_type" id="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $name ); ?>" <?php checked( $name, $connection_type ); ?> <?php echo $disabled; ?> /> 1861 1865 <?php echo $text; ?> 1862 1866 </label> 1863 <?php1867 <?php 1864 1868 endforeach; 1865 ?>1869 ?> 1866 1870 </fieldset> 1867 <?php1868 if ( isset( $types['ssh'] ) ) {1869 $hidden_class = '';1870 if ( 'ssh' != $connection_type || empty( $connection_type ) ) {1871 $hidden_class = ' class="hidden"';1872 }1873 ?>1871 <?php 1872 if ( isset( $types['ssh'] ) ) { 1873 $hidden_class = ''; 1874 if ( 'ssh' != $connection_type || empty( $connection_type ) ) { 1875 $hidden_class = ' class="hidden"'; 1876 } 1877 ?> 1874 1878 <fieldset id="ssh-keys"<?php echo $hidden_class; ?>> 1875 1879 <legend><?php _e( 'Authentication Keys' ); ?></legend> … … 1884 1888 <p id="auth-keys-desc"><?php _e( 'Enter the location on the server where the public and private keys are located. If a passphrase is needed, enter that in the password field above.' ); ?></p> 1885 1889 </fieldset> 1886 <?php1887 }1888 1889 foreach ( (array) $extra_fields as $field ) {1890 if ( isset( $submitted_form[ $field ] ) ) {1891 echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( $submitted_form[ $field ] ) . '" />';1892 }1893 }1894 ?>1890 <?php 1891 } 1892 1893 foreach ( (array) $extra_fields as $field ) { 1894 if ( isset( $submitted_form[ $field ] ) ) { 1895 echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( $submitted_form[ $field ] ) . '" />'; 1896 } 1897 } 1898 ?> 1895 1899 <p class="request-filesystem-credentials-action-buttons"> 1896 1900 <?php wp_nonce_field( 'filesystem-credentials', '_fs_nonce', false, true ); ?> … … 1900 1904 </div> 1901 1905 </form> 1902 <?php1906 <?php 1903 1907 return false; 1904 1908 } … … 1954 1958 function wp_privacy_generate_personal_data_export_group_html( $group_data ) { 1955 1959 $allowed_tags = array( 1956 'a' => array(1960 'a' => array( 1957 1961 'href' => array(), 1958 'target' => array() 1962 'target' => array(), 1959 1963 ), 1960 'br' => array() 1964 'br' => array(), 1961 1965 ); 1962 1966 $allowed_protocols = array( 'http', 'https' ); … … 2042 2046 $html_report_filename = $file_basename . '.html'; 2043 2047 $html_report_pathname = wp_normalize_path( $exports_dir . $html_report_filename ); 2044 $file = fopen( $html_report_pathname, 'w' );2048 $file = fopen( $html_report_pathname, 'w' ); 2045 2049 if ( false === $file ) { 2046 2050 wp_send_json_error( __( 'Unable to open export file (HTML report) for writing.' ) ); … … 2061 2065 fwrite( $file, "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />\n" ); 2062 2066 fwrite( $file, "<style type='text/css'>" ); 2063 fwrite( $file, "body { color: black; font-family: Arial, sans-serif; font-size: 11pt; margin: 15px auto; width: 860px; }");2064 fwrite( $file, "table { background: #f0f0f0; border: 1px solid #ddd; margin-bottom: 20px; width: 100%; }");2065 fwrite( $file, "th { padding: 5px; text-align: left; width: 20%; }");2066 fwrite( $file, "td { padding: 5px; }");2067 fwrite( $file, "tr:nth-child(odd) { background-color: #fafafa; }");2068 fwrite( $file, "</style>");2069 fwrite( $file, "<title>");2067 fwrite( $file, 'body { color: black; font-family: Arial, sans-serif; font-size: 11pt; margin: 15px auto; width: 860px; }' ); 2068 fwrite( $file, 'table { background: #f0f0f0; border: 1px solid #ddd; margin-bottom: 20px; width: 100%; }' ); 2069 fwrite( $file, 'th { padding: 5px; text-align: left; width: 20%; }' ); 2070 fwrite( $file, 'td { padding: 5px; }' ); 2071 fwrite( $file, 'tr:nth-child(odd) { background-color: #fafafa; }' ); 2072 fwrite( $file, '</style>' ); 2073 fwrite( $file, '<title>' ); 2070 2074 fwrite( $file, esc_html( $title ) ); 2071 fwrite( $file, "</title>");2075 fwrite( $file, '</title>' ); 2072 2076 fwrite( $file, "</head>\n" ); 2073 2077 … … 2076 2080 2077 2081 // Heading. 2078 fwrite( $file, "<h1>" . esc_html__( 'Personal Data Export' ) . "</h1>");2082 fwrite( $file, '<h1>' . esc_html__( 'Personal Data Export' ) . '</h1>' ); 2079 2083 2080 2084 // And now, all the Groups. … … 2198 2202 $expiration_date = date_i18n( get_option( 'date_format' ), time() + $expiration ); 2199 2203 2200 /* translators: Do not translate EXPIRATION, LINK, SITENAME, SITEURL: those are placeholders. */2201 $email_text = __(2202 'Howdy,2204 /* translators: Do not translate EXPIRATION, LINK, SITENAME, SITEURL: those are placeholders. */ 2205 $email_text = __( 2206 'Howdy, 2203 2207 2204 2208 Your request for an export of personal data has been completed. You may … … 2212 2216 All at ###SITENAME### 2213 2217 ###SITEURL###' 2214 );2218 ); 2215 2219 2216 2220 /** … … 2230 2234 $content = apply_filters( 'wp_privacy_personal_data_email_content', $email_text, $request_id ); 2231 2235 2232 $email_address = $request->email;2236 $email_address = $request->email; 2233 2237 $export_file_url = get_post_meta( $request_id, '_export_file_url', true ); 2234 $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );2235 $site_url = home_url();2238 $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); 2239 $site_url = home_url(); 2236 2240 2237 2241 $content = str_replace( '###EXPIRATION###', $expiration_date, $content ); … … 2314 2318 // If we are not yet on the last page of the last exporter, return now. 2315 2319 /** This filter is documented in wp-admin/includes/ajax-actions.php */ 2316 $exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() );2320 $exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() ); 2317 2321 $is_last_exporter = $exporter_index === count( $exporters ); 2318 $exporter_done = $response['done'];2322 $exporter_done = $response['done']; 2319 2323 if ( ! $is_last_exporter || ! $exporter_done ) { 2320 2324 return $response; … … 2340 2344 } 2341 2345 2342 $old_item_data = $groups[ $group_id ]['items'][ $item_id ];2343 $merged_item_data = array_merge( $export_datum['data'], $old_item_data );2346 $old_item_data = $groups[ $group_id ]['items'][ $item_id ]; 2347 $merged_item_data = array_merge( $export_datum['data'], $old_item_data ); 2344 2348 $groups[ $group_id ]['items'][ $item_id ] = $merged_item_data; 2345 2349 }
Note: See TracChangeset
for help on using the changeset viewer.