You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a souped-up version of the [Normalizer plugin](https://wordpress.org/plugins/normalizer/"Normalizer - WordPress Plugins") by [Torsten Landsiedel](https://profiles.wordpress.org/zodiac1978/).
19
18
20
-
It adds WP filters to normalize UTF-8 data coming into the system to the
21
-
[de facto web standard Normalization Form C](https://www.w3.org/International/docs/charmod-norm/#choice-of-normalization-form"Choice of Normalization Form").
22
-
The Unicode Consortium report is at [Unicode Normalization Forms](http://www.unicode.org/reports/tr15/).
19
+
It adds WP filters to normalize UTF-8 data coming into the system to the [de facto web standard Normalization Form C](https://www.w3.org/International/docs/charmod-norm/#choice-of-normalization-form"Choice of Normalization Form"). The Unicode Consortium report is at [Unicode Normalization Forms](http://www.unicode.org/reports/tr15/).
23
20
24
21
### Polyfills ###
25
22
26
-
For best performance [install](http://php.net/manual/en/intl.installation.php) (if possible)
27
-
the [PHP Internationalization extension `Intl`](http://php.net/manual/en/intro.intl.php),
28
-
which includes the PHP class `Normalizer`.
23
+
For best performance [install](http://php.net/manual/en/intl.installation.php) (if possible) the [PHP Internationalization extension `Intl`](http://php.net/manual/en/intro.intl.php), which includes the PHP class `Normalizer`.
29
24
30
-
However the plugin works without the PHP `Intl` extension being installed, as it uses (a modified version of)
31
-
the [Symfony `Normalizer` polyfill](https://github.com/symfony/polyfill/tree/master/src/Intl/Normalizer).
25
+
However the plugin works without the PHP `Intl` extension being installed, as it uses (a modified version of) the [Symfony `Normalizer` polyfill](https://github.com/symfony/polyfill/tree/master/src/Intl/Normalizer).
32
26
33
-
Also text pasted into (most) inputs is normalized immediately using the JavaScript [`normalize()` method](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/normalize).
34
-
For browsers without normalization support, the [unorm polyfill](https://github.com/walling/unorm) is used.
27
+
Also text pasted into (most) inputs is normalized immediately using the JavaScript [`normalize()` method](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/normalize). For browsers without normalization support, the [unorm polyfill](https://github.com/walling/unorm) is used.
35
28
36
29
### Background ###
37
30
38
-
For further info, see the WP Trac ticket [#30130 Normalize characters with combining marks to precomposed characters](https://core.trac.wordpress.org/ticket/30130)
39
-
and this [Make WP Core comment](https://make.wordpress.org/core/2016/05/17/may-17-feature-projects-chat-and-prompt/#comment-30300).
31
+
For further info, see the WP Trac ticket [#30130 Normalize characters with combining marks to precomposed characters](https://core.trac.wordpress.org/ticket/30130) and this [Make WP Core comment](https://make.wordpress.org/core/2016/05/17/may-17-feature-projects-chat-and-prompt/#comment-30300).
40
32
41
33
The plugin also works around the Safari-specific issues raised by the WP Trac ticket [#22363 Accents in attachment filenames should be sanitized](https://core.trac.wordpress.org/ticket/22363).
42
34
43
35
### Scanner ###
44
36
45
-
For existing data, the plugin includes an administration tool to scan and normalize the database.
46
-
**Important:** before using this tool to normalize, please [backup your database](https://codex.wordpress.org/WordPress_Backups).
47
-
This is especially important if your database contains non-normalized serialized data, as this plugin uses the same suck-and-see technique as interconnect/it's
48
-
[Database Search and Replace Script in PHP](https://interconnectit.com/products/search-and-replace-for-wordpress-databases/) to deal with serialized
49
-
data, and is fallible.
37
+
For existing data, the plugin includes an administration tool to scan and normalize the database. **Important:** before using this tool to normalize, please [backup your database](https://codex.wordpress.org/WordPress_Backups). This is especially important if your database contains non-normalized serialized data, as this plugin uses the same suck-and-see technique as interconnect/it's [Database Search and Replace Script in PHP](https://interconnectit.com/products/search-and-replace-for-wordpress-databases/) to deal with serialized data, and is fallible.
50
38
51
39
### And ###
52
40
53
41
A google-cheating schoolboy French translation is supplied.
54
42
55
-
The plugin should run on PHP 5.2.17 to 7.0.13, and on WP 3.9.13 to 4.7.0.
43
+
The plugin should run on PHP 5.2.17 to 7.1, and on WP 3.9.13 to 4.7.1.
56
44
57
45
The project is on [github](https://github.com/gitlost/unfc-normalize).
58
46
@@ -64,23 +52,23 @@ Install in the standard way via the 'Plugins' menu in WordPress and then activat
64
52
65
53
### How can I normalize extra stuff? ###
66
54
67
-
You can add normalization to anything that passes its content through a filter. The canonical way is to use the `unfc_extra_filters` filter which returns an array of filter names -
68
-
for instance, in your theme's `functions.php` file, add:
55
+
You can add normalization to anything that passes its content through a filter. The canonical way is to use the `unfc_extra_filters` filter which returns an array of filter names - for instance, in your theme's `functions.php` file, add:
69
56
70
57
function mytheme_unfc_extra_filters( $extra_filters ) {
Note that the `unfc_extra_filters` filter is only called in the administration backend. You can also add a filter directly, to be called in the frontend or backend, by referencing the
77
-
global PHP variable `unfc_normalize`, but you should ensure that the `Normalizer` polyfill is loaded if you don't have the PHP `Intl` extension installed:
63
+
Note that the `unfc_extra_filters` filter is only called in the administration backend. You can also add a filter directly, to be called in the frontend or backend, by referencing the global PHP variable `unfc_normalize`, but you should ensure that the `Normalizer` polyfill is loaded if you don't have the PHP `Intl` extension installed:
78
64
79
65
global $unfc_normalize;
80
-
if ( ! function_exists( 'normalizer_is_normalized' ) ) { // If the "Intl" extension is not installed...
81
-
$unfc_normalize->load_unfc_normalizer_class(); // ...load the polyfill.
66
+
if ( $unfc_normalize ) {
67
+
if ( ! function_exists( 'normalizer_is_normalized' ) ) { // If the "Intl" extension is not installed...
68
+
$unfc_normalize->load_unfc_normalizer_class(); // ...load the polyfill.
69
+
}
70
+
add_filter( 'myfilter', array( $unfc_normalize, 'normalize' ), 6 /* Or whatever priority you choose */ );
82
71
}
83
-
add_filter( 'myfilter', array( $unfc_normalize, 'normalize' ), 6 /* Or whatever priority you choose */ );
84
72
85
73
### Does it have a tool to normalize the filenames of files uploaded prior to its enabling? ###
86
74
@@ -103,6 +91,11 @@ No, it doesn't. Alas, such files would have to re-uploaded. However if (enough -
103
91
104
92
## Changelog ##
105
93
94
+
### 1.0.6 ###
95
+
* Require explicit define of UNFC_DEBUG. Move load of debug file to 'init'.
96
+
* Safari submit workaround.
97
+
* WP 4.7.1 compatible.
98
+
106
99
### 1.0.5 ###
107
100
* Do load of normalizer in slugs list constructor not items list. Fixes slugs listing crash when Intl extension not installed.
108
101
* Ignore case when checking charset (UNFC_Normalize::is_blog_utf8()).
@@ -144,6 +137,9 @@ No, it doesn't. Alas, such files would have to re-uploaded. However if (enough -
144
137
145
138
## Upgrade Notice ##
146
139
140
+
### 1.0.6 ###
141
+
Less noisy when WP_DEBUG set.
142
+
147
143
### 1.0.5 ###
148
144
Fixes fatal error on check slugs listing in DB check tool when Intl extension not available.
0 commit comments