WordPress 4.1.4 wordpress-4.1.4
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Sun, 3 May 2015 18:52:55 +0000 (11:52 -0700)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Sun, 3 May 2015 18:52:55 +0000 (11:52 -0700)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
readme.html
wp-admin/about.php
wp-admin/includes/upgrade.php
wp-includes/version.php
wp-includes/wp-db.php

index 09f0376eb253447dee335cee4bdde77aa77668a5..0d2eac701b7dc09fd66f2320f63748693c9cdfbf 100644 (file)
@@ -9,7 +9,7 @@
 <body>
 <h1 id="logo">
        <a href="https://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
 <body>
 <h1 id="logo">
        <a href="https://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
-       <br /> Version 4.1.3
+       <br /> Version 4.1.4
 </h1>
 <p style="text-align: center">Semantic Personal Publishing Platform</p>
 
 </h1>
 <p style="text-align: center">Semantic Personal Publishing Platform</p>
 
index b0ec9a436614704898c1ca4009f535a0ec45012e..04dc411c49943f9a129c0a372562f61e2ffd115d 100644 (file)
@@ -42,7 +42,11 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
 </h2>
 
 <div class="changelog point-releases">
 </h2>
 
 <div class="changelog point-releases">
-       <h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 3 ); ?></h3>
+       <h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 4 ); ?></h3>
+       <p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
+         '<strong>Version %1$s</strong> addressed some security issues.', 1 ), '4.1.4' ); ?>
+               <?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_4.1.4' ); ?>
+       </p>
        <p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
          '<strong>Version %1$s</strong> addressed %2$s bugs.', 1 ), '4.1.3', number_format_i18n( 1 ) ); ?>
                <?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_4.1.3' ); ?>
        <p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
          '<strong>Version %1$s</strong> addressed %2$s bugs.', 1 ), '4.1.3', number_format_i18n( 1 ) ); ?>
                <?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_4.1.3' ); ?>
index 15a1097fe831f8feee879220858d7bfead93d296..b8e3701158a79393855a7e9d0b8b7b03e1f172e2 100644 (file)
@@ -442,6 +442,9 @@ function upgrade_all() {
        if ( $wp_current_db_version < 29630 )
                upgrade_400();
 
        if ( $wp_current_db_version < 29630 )
                upgrade_400();
 
+       if ( $wp_current_db_version < 30134 )
+               upgrade_414();
+
        maybe_disable_link_manager();
 
        maybe_disable_automattic_widgets();
        maybe_disable_link_manager();
 
        maybe_disable_automattic_widgets();
@@ -1328,6 +1331,33 @@ function upgrade_400() {
        }
 }
 
        }
 }
 
+/**
+ * Execute changes made in WordPress 4.1.4.
+ *
+ * @since 4.1.3
+ */
+function upgrade_414() {
+       global $wp_current_db_version, $wpdb;
+
+       if ( $wp_current_db_version < 30134 ) {
+               $content_length = $wpdb->get_col_length( $wpdb->comments, 'comment_content' );
+               if ( ! $content_length ) {
+                       $content_length = 65535;
+               }
+
+               $comments = $wpdb->get_results(
+                       "SELECT comment_ID FROM $wpdb->comments
+                       WHERE comment_date_gmt > '2015-04-26'
+                       AND CHAR_LENGTH( comment_content ) >= $content_length
+                       AND ( comment_content LIKE '%<%' OR comment_content LIKE '%>%' )"
+               );
+
+               foreach ( $comments as $comment ) {
+                       wp_delete_comment( $comment->comment_ID, true );
+               }
+       }
+}
+
 /**
  * Execute network level changes
  *
 /**
  * Execute network level changes
  *
index b3bb8584a3ec8ac5bc50c6e42a92cdd995fc2961..0684eb84c1d94cbd2c29f9268aa88598256b4d5a 100644 (file)
@@ -4,14 +4,14 @@
  *
  * @global string $wp_version
  */
  *
  * @global string $wp_version
  */
-$wp_version = '4.1.3';
+$wp_version = '4.1.4';
 
 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
  *
  * @global int $wp_db_version
  */
 
 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
  *
  * @global int $wp_db_version
  */
-$wp_db_version = 30133;
+$wp_db_version = 30134;
 
 /**
  * Holds the TinyMCE version
 
 /**
  * Holds the TinyMCE version
index b3eed896ec4d5915b8ad51ac69d7ed6d409c54a4..6eb0c75dc173d345d7e5cb8d5bd05285a90e875a 100644 (file)
@@ -1926,11 +1926,20 @@ class wpdb {
         */
        protected function process_fields( $table, $data, $format ) {
                $data = $this->process_field_formats( $data, $format );
         */
        protected function process_fields( $table, $data, $format ) {
                $data = $this->process_field_formats( $data, $format );
+               if ( false === $data ) {
+                       return false;
+               }
+
                $data = $this->process_field_charsets( $data, $table );
                if ( false === $data ) {
                        return false;
                }
 
                $data = $this->process_field_charsets( $data, $table );
                if ( false === $data ) {
                        return false;
                }
 
+               $data = $this->process_field_lengths( $data, $table );
+               if ( false === $data ) {
+                       return false;
+               }
+
                $converted_data = $this->strip_invalid_text( $data );
 
                if ( $data !== $converted_data ) {
                $converted_data = $this->strip_invalid_text( $data );
 
                if ( $data !== $converted_data ) {
@@ -2011,6 +2020,40 @@ class wpdb {
                return $data;
        }
 
                return $data;
        }
 
+       /**
+        * For string fields, record the maximum string length that field can safely save.
+        *
+        * @since 4.2.1
+        * @access protected
+        *
+        * @param array  $data  As it comes from the wpdb::process_field_charsets() method.
+        * @param string $table Table name.
+        * @return array|False The same array as $data with additional 'length' keys, or false if
+        *                     any of the values were too long for their corresponding field.
+        */
+       protected function process_field_lengths( $data, $table ) {
+               foreach ( $data as $field => $value ) {
+                       if ( '%d' === $value['format'] || '%f' === $value['format'] ) {
+                               // We can skip this field if we know it isn't a string.
+                               // This checks %d/%f versus ! %s because it's sprintf() could take more.
+                               $value['length'] = false;
+                       } else {
+                               $value['length'] = $this->get_col_length( $table, $field );
+                               if ( is_wp_error( $value['length'] ) ) {
+                                       return false;
+                               }
+                       }
+
+                       if ( false !== $value['length'] && strlen( $value['value'] ) > $value['length'] ) {
+                               return false;
+                       }
+
+                       $data[ $field ] = $value;
+               }
+
+               return $data;
+       }
+
        /**
         * Retrieve one variable from the database.
         *
        /**
         * Retrieve one variable from the database.
         *
@@ -2335,6 +2378,77 @@ class wpdb {
                return $charset;
        }
 
                return $charset;
        }
 
+       /**
+        * Retrieve the maximum string length allowed in a given column.
+        *
+        * @since 4.2.1
+        * @access public
+        *
+        * @param string $table  Table name.
+        * @param string $column Column name.
+        * @return mixed Max column length as an int. False if the column has no
+        *               length. WP_Error object if there was an error.
+        */
+       public function get_col_length( $table, $column ) {
+               $tablekey = strtolower( $table );
+               $columnkey = strtolower( $column );
+
+               // Skip this entirely if this isn't a MySQL database.
+               if ( false === $this->is_mysql ) {
+                       return false;
+               }
+
+               if ( empty( $this->col_meta[ $tablekey ] ) ) {
+                       // This primes column information for us.
+                       $table_charset = $this->get_table_charset( $table );
+                       if ( is_wp_error( $table_charset ) ) {
+                               return $table_charset;
+                       }
+               }
+
+               if ( empty( $this->col_meta[ $tablekey ][ $columnkey ] ) ) {
+                       return false;
+               }
+
+               $typeinfo = explode( '(', $this->col_meta[ $tablekey ][ $columnkey ]->Type );
+
+               $type = strtolower( $typeinfo[0] );
+               if ( ! empty( $typeinfo[1] ) ) {
+                       $length = trim( $typeinfo[1], ')' );
+               } else {
+                       $length = false;
+               }
+
+               switch( $type ) {
+                       case 'binary':
+                       case 'char':
+                       case 'varbinary':
+                       case 'varchar':
+                               return $length;
+                               break;
+                       case 'tinyblob':
+                       case 'tinytext':
+                               return 255; // 2^8 - 1
+                               break;
+                       case 'blob':
+                       case 'text':
+                               return 65535; // 2^16 - 1
+                               break;
+                       case 'mediumblob':
+                       case 'mediumtext':
+                               return 16777215; // 2^24 - 1
+                               break;
+                       case 'longblob':
+                       case 'longtext':
+                               return 4294967295; // 2^32 - 1
+                               break;
+                       default:
+                               return false;
+               }
+
+               return false;
+       }
+
        /**
         * Check if a string is ASCII.
         *
        /**
         * Check if a string is ASCII.
         *