PluginProbe
Polylang / 2.5
Polylang v2.5
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 | admin/admin-strings.php +9 -11 2.82.5 View file →
@@ -1,8 +1,5 @@
1 1 <?php
2 -/**
3 - * @package Polylang
4 - */
5 2
6 3 /**
7 4 * A fully static class to manage strings translations on admin side
8 5 *
@@ -8,10 +5,10 @@
8 5 *
9 6 * @since 1.6
10 7 */
11 8 class PLL_Admin_Strings {
12 - protected static $strings = array(); // strings to translate
13 - protected static $default_strings; // default strings to register
9 + static protected $strings = array(); // strings to translate
10 + static protected $default_strings; // default strings to register
14 11
15 12 /**
16 13 * Add filters
17 14 *
@@ -53,12 +50,12 @@
53 50 */
54 51 public static function &get_strings() {
55 52 self::$default_strings = array(
56 53 'options' => array(
57 - 'blogname' => __( 'Site Title', 'polylang' ),
58 - 'blogdescription' => __( 'Tagline', 'polylang' ),
59 - 'date_format' => __( 'Date Format', 'polylang' ),
60 - 'time_format' => __( 'Time Format', 'polylang' ),
54 + 'blogname' => __( 'Site Title' ),
55 + 'blogdescription' => __( 'Tagline' ),
56 + 'date_format' => __( 'Date Format' ),
57 + 'time_format' => __( 'Time Format' ),
61 58 ),
62 59 'widget_title' => __( 'Widget title', 'polylang' ),
63 60 'widget_text' => __( 'Widget text', 'polylang' ),
64 61 );
@@ -120,8 +117,9 @@
120 117 * @param string $name unique name for the string
121 118 * @return string
122 119 */
123 120 public static function sanitize_string_translation( $translation, $name ) {
121 + $translation = wp_unslash( trim( $translation ) );
124 122
125 123 if ( false !== ( $option = array_search( $name, self::$default_strings['options'], true ) ) ) {
126 124 $translation = sanitize_option( $option, $translation );
127 125 }
@@ -126,13 +124,13 @@
126 124 $translation = sanitize_option( $option, $translation );
127 125 }
128 126
129 127 if ( $name == self::$default_strings['widget_title'] ) {
130 - $translation = sanitize_text_field( $translation );
128 + $translation = strip_tags( $translation );
131 129 }
132 130
133 131 if ( $name == self::$default_strings['widget_text'] && ! current_user_can( 'unfiltered_html' ) ) {
134 - $translation = wp_kses_post( $translation );
132 + $translation = wp_unslash( wp_filter_post_kses( addslashes( $translation ) ) ); // wp_filter_post_kses() expects slashed
135 133 }
136 134
137 135 return $translation;
138 136 }