PluginProbe
Polylang / 2.6.2
Polylang v2.6.2
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | settings/table-string.php +4 -7 2.7.42.6.2 View file →
@@ -215,9 +215,8 @@
215 215 $languages = $this->languages;
216 216 }
217 217
218 218 // Load translations
219 - $mo = array();
220 219 foreach ( $languages as $language ) {
221 220 $mo[ $language->slug ] = new PLL_MO();
222 221 $mo[ $language->slug ]->import_from_db( $language );
223 222 }
@@ -350,20 +349,18 @@
350 349
351 350 $mo = new PLL_MO();
352 351 $mo->import_from_db( $language );
353 352
354 - $translations = array_map( 'trim', wp_unslash( $_POST['translation'][ $language->slug ] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
355 - foreach ( $translations as $key => $translation ) {
353 + foreach ( $_POST['translation'][ $language->slug ] as $key => $translation ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
356 354 /**
357 355 * Filter the string translation before it is saved in DB
358 356 * Allows to sanitize strings registered with pll_register_string
359 357 *
360 358 * @since 1.6
361 - * @since 2.7 The translation passed to the filter is unslashed.
362 359 *
363 - * @param string $translation The string translation.
364 - * @param string $name The name as defined in pll_register_string.
365 - * @param string $context The context as defined in pll_register_string.
360 + * @param string $translation the string translation
361 + * @param string $name the name as defined in pll_register_string
362 + * @param string $context the context as defined in pll_register_string
366 363 */
367 364 $translation = apply_filters( 'pll_sanitize_string_translation', $translation, $this->strings[ $key ]['name'], $this->strings[ $key ]['context'] );
368 365 $mo->add_entry( $mo->make_entry( $this->strings[ $key ]['string'], $translation ) );
369 366 }