PluginProbe
Import WP – CSV & XML Import Export for WordPress / 2.15.0
Import WP – CSV & XML Import Export for WordPress v2.15.0
2.15.1 2.15.0 2.14.24 2.14.23 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.9.0 2.9.1 All 144 releases
← All changes | class/Common/Importer/Config/Config.php +17 -4 2.7.14 → 2.15.0 View file →
@@ -90,9 +90,9 @@
90 90 }
91 91
92 92 $file = $this->getIndexFile($key);
93 93 if (!file_exists($file)) {
94 - throw new FileException("Config Index File Not Found: " . $file);
94 + throw new FileException(sprintf(__("Config Index File Not Found: %s", 'jc-importer'), $file));
95 95 }
96 96
97 97 $fh = fopen($file, 'r');
98 98 $counter = 0;
@@ -157,9 +157,9 @@
157 157 $counter += $separator_line_count;
158 158 }
159 159
160 160 if (count($cache) < 2) {
161 - throw new FileException("Unable to located record: " . ($record + 1) . ".");
161 + throw new FileException(sprintf(__("Unable to located record: %s.", 'jc-importer'), ($record + 1)));
162 162 }
163 163
164 164 // store cache
165 165 $this->config['cached_indices'] = [
@@ -187,9 +187,18 @@
187 187 }
188 188
189 189 public function readIndexes($key)
190 190 {
191 - return $this->hasIndexed($key);
191 + if (!$this->hasIndexed($key)) {
192 + return false;
193 + }
194 +
195 + // Treat a zero-record index as missing so it can be rebuilt
196 + if (!isset($this->config['count'][$key]) || intval($this->config['count'][$key]) < 1) {
197 + return false;
198 + }
199 +
200 + return true;
192 201 }
193 202
194 203 public function storeIndexes($key, $buffer = false)
195 204 {
@@ -233,9 +242,13 @@
233 242 }
234 243
235 244 public function getRecordCount($key)
236 245 {
237 - return $this->config['count'][$key];
246 + if (!isset($this->config['count'][$key])) {
247 + return 0;
248 + }
249 +
250 + return intval($this->config['count'][$key]);
238 251 }
239 252
240 253 public function getIndexFile($key)
241 254 {