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 -10 2.8.22.6.2 View file →
@@ -1,8 +1,5 @@
1 1 <?php
2 -/**
3 - * @package Polylang
4 - */
5 2
6 3 if ( ! class_exists( 'WP_List_Table' ) ) {
7 4 require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; // since WP 3.1
8 5 }
@@ -218,9 +215,8 @@
218 215 $languages = $this->languages;
219 216 }
220 217
221 218 // Load translations
222 - $mo = array();
223 219 foreach ( $languages as $language ) {
224 220 $mo[ $language->slug ] = new PLL_MO();
225 221 $mo[ $language->slug ]->import_from_db( $language );
226 222 }
@@ -353,20 +349,18 @@
353 349
354 350 $mo = new PLL_MO();
355 351 $mo->import_from_db( $language );
356 352
357 - $translations = array_map( 'trim', wp_unslash( $_POST['translation'][ $language->slug ] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
358 - foreach ( $translations as $key => $translation ) {
353 + foreach ( $_POST['translation'][ $language->slug ] as $key => $translation ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
359 354 /**
360 355 * Filter the string translation before it is saved in DB
361 356 * Allows to sanitize strings registered with pll_register_string
362 357 *
363 358 * @since 1.6
364 - * @since 2.7 The translation passed to the filter is unslashed.
365 359 *
366 - * @param string $translation The string translation.
367 - * @param string $name The name as defined in pll_register_string.
368 - * @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
369 363 */
370 364 $translation = apply_filters( 'pll_sanitize_string_translation', $translation, $this->strings[ $key ]['name'], $this->strings[ $key ]['context'] );
371 365 $mo->add_entry( $mo->make_entry( $this->strings[ $key ]['string'], $translation ) );
372 366 }