| @@ -112,10 +112,11 @@ | ||
| 112 | 112 | $this->log( sprintf( 'modified %s', $file ), Scan_Controller::SCAN_LOG ); |
| 113 | 113 | $model->add_item( |
| 114 | 114 | Scan_Item::TYPE_INTEGRITY, |
| 115 | 115 | array( |
| 116 | - 'file' => $file, | |
| 117 | - 'type' => 'modified', | |
| 116 | + 'file' => $file, | |
| 117 | + 'type' => 'modified', | |
| 118 | + 'checksum' => $checksums[ $rev_file ], | |
| 118 | 119 | ) |
| 119 | 120 | ); |
| 120 | 121 | } |
| 121 | 122 | } else { |
| @@ -129,8 +130,14 @@ | ||
| 129 | 130 | continue; |
| 130 | 131 | } |
| 131 | 132 | $item_type = 'dir'; |
| 132 | 133 | } else { |
| 134 | + // Sometimes plugins create duplicate readme files. If the content is identical, we'll ignore the issue. | |
| 135 | + if ( isset( $checksums['readme.html'] ) && $this->compare_hashes( $file, $checksums['readme.html'] ) ) { | |
| 136 | + $this->log( sprintf( 'skip %s because this is just the same renamed readme file', $file ), Scan_Controller::SCAN_LOG ); | |
| 137 | + $core_files->next(); | |
| 138 | + continue; | |
| 139 | + } | |
| 133 | 140 | $item_type = 'unversion'; |
| 134 | 141 | } |
| 135 | 142 | |
| 136 | 143 | $model->add_item( |
| @@ -155,11 +162,9 @@ | ||
| 155 | 162 | // We will check if we have any ignore issue from last scan, so we can bring it here. |
| 156 | 163 | $last = Scan::get_last(); |
| 157 | 164 | if ( is_object( $last ) ) { |
| 158 | 165 | $ignored_issues = $last->get_issues( Scan_Item::TYPE_INTEGRITY, Scan_Item::STATUS_IGNORE ); |
| 159 | - foreach ( $ignored_issues as $issue ) { | |
| 160 | - $model->add_item( Scan_Item::TYPE_INTEGRITY, $issue->raw_data, Scan_Item::STATUS_IGNORE ); | |
| 161 | - } | |
| 166 | + $model->carry_forward_ignored_issues( Scan_Item::TYPE_INTEGRITY, $ignored_issues, 'file' ); | |
| 162 | 167 | } |
| 163 | 168 | // Done, reset this, so we can use it later. |
| 164 | 169 | $model->task_checkpoint = ''; |
| 165 | 170 | } |
| @@ -184,9 +189,10 @@ | ||
| 184 | 189 | |
| 185 | 190 | if ( ! function_exists( 'get_core_checksums' ) ) { |
| 186 | 191 | include_once ABSPATH . 'wp-admin/includes/update.php'; |
| 187 | 192 | } |
| 188 | - $checksums = get_core_checksums( $wp_version, empty( $wp_local_package ) ? 'en_US' : $wp_local_package ); | |
| 193 | + $locale = isset( $wp_local_package ) && '' !== $wp_local_package ? $wp_local_package : 'en_US'; | |
| 194 | + $checksums = get_core_checksums( $wp_version, $locale ); | |
| 189 | 195 | if ( false === $checksums ) { |
| 190 | 196 | $this->log( 'Error from fetching checksums from wp.org', Scan_Controller::SCAN_LOG ); |
| 191 | 197 | $scan = $this->owner->scan; |
| 192 | 198 | $scan->status = Scan::STATUS_IDLE; |