This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Remove accents from files on upload | |
* Plugin URI: https://gist.github.com/onnimonni/d58bdcff44f8208a15c7 | |
* Description: Sanitize accents from Cyrillic, German, French, Polish, Spanish, Hungarian, Czech, Greek, Swedish during upload. Also fix OS-X NFD filenames. | |
* Version: 1.0 | |
* Author: Onni Hakala | |
* Author URI: http://github.com/onnimonni | |
* License: GPLv3 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paraphrased from http://teppo.tv/haikueditori/haikueditori.js | |
var rVowels = /[aeiouyåäö]/i; | |
var rConsonants = /[bcdfghjklmnpqrstvwxz]/i; | |
var rDiphthongs = /(aa|ee|ii|oo|uu|yy|åå|ää|öö|ai|ei|oi|ui|yi|åi|äi|öi|au|eu|iu|ou|äy|öy|ie|uo|yö|ey|iy)/i; | |
function isVowel(chr) { | |
return rVowels.test(chr); | |
} |
NewerOlder