Edit File by line
/home/barbar84/www/wp-inclu...
File: formatting.php
* | U+1ED0 | Ố | O | Latin capital letter O with circumflex and acute |
[1500] Fix | Delete
* | U+1ED1 | ố | o | Latin small letter o with circumflex and acute |
[1501] Fix | Delete
* | U+1ED2 | Ồ | O | Latin capital letter O with circumflex and grave |
[1502] Fix | Delete
* | U+1ED3 | ồ | o | Latin small letter o with circumflex and grave |
[1503] Fix | Delete
* | U+1ED4 | Ổ | O | Latin capital letter O with circumflex and hook above |
[1504] Fix | Delete
* | U+1ED5 | ổ | o | Latin small letter o with circumflex and hook above |
[1505] Fix | Delete
* | U+1ED6 | Ỗ | O | Latin capital letter O with circumflex and tilde |
[1506] Fix | Delete
* | U+1ED7 | ỗ | o | Latin small letter o with circumflex and tilde |
[1507] Fix | Delete
* | U+1ED8 | Ộ | O | Latin capital letter O with circumflex and dot below |
[1508] Fix | Delete
* | U+1ED9 | ộ | o | Latin small letter o with circumflex and dot below |
[1509] Fix | Delete
* | U+1EDA | Ớ | O | Latin capital letter O with horn and acute |
[1510] Fix | Delete
* | U+1EDB | ớ | o | Latin small letter o with horn and acute |
[1511] Fix | Delete
* | U+1EDC | Ờ | O | Latin capital letter O with horn and grave |
[1512] Fix | Delete
* | U+1EDD | ờ | o | Latin small letter o with horn and grave |
[1513] Fix | Delete
* | U+1EDE | Ở | O | Latin capital letter O with horn and hook above |
[1514] Fix | Delete
* | U+1EDF | ở | o | Latin small letter o with horn and hook above |
[1515] Fix | Delete
* | U+1EE0 | Ỡ | O | Latin capital letter O with horn and tilde |
[1516] Fix | Delete
* | U+1EE1 | ỡ | o | Latin small letter o with horn and tilde |
[1517] Fix | Delete
* | U+1EE2 | Ợ | O | Latin capital letter O with horn and dot below |
[1518] Fix | Delete
* | U+1EE3 | ợ | o | Latin small letter o with horn and dot below |
[1519] Fix | Delete
* | U+1EE4 | Ụ | U | Latin capital letter U with dot below |
[1520] Fix | Delete
* | U+1EE5 | ụ | u | Latin small letter u with dot below |
[1521] Fix | Delete
* | U+1EE6 | Ủ | U | Latin capital letter U with hook above |
[1522] Fix | Delete
* | U+1EE7 | ủ | u | Latin small letter u with hook above |
[1523] Fix | Delete
* | U+1EE8 | Ứ | U | Latin capital letter U with horn and acute |
[1524] Fix | Delete
* | U+1EE9 | ứ | u | Latin small letter u with horn and acute |
[1525] Fix | Delete
* | U+1EEA | Ừ | U | Latin capital letter U with horn and grave |
[1526] Fix | Delete
* | U+1EEB | ừ | u | Latin small letter u with horn and grave |
[1527] Fix | Delete
* | U+1EEC | Ử | U | Latin capital letter U with horn and hook above |
[1528] Fix | Delete
* | U+1EED | ử | u | Latin small letter u with horn and hook above |
[1529] Fix | Delete
* | U+1EEE | Ữ | U | Latin capital letter U with horn and tilde |
[1530] Fix | Delete
* | U+1EEF | ữ | u | Latin small letter u with horn and tilde |
[1531] Fix | Delete
* | U+1EF0 | Ự | U | Latin capital letter U with horn and dot below |
[1532] Fix | Delete
* | U+1EF1 | ự | u | Latin small letter u with horn and dot below |
[1533] Fix | Delete
* | U+1EF2 | Ỳ | Y | Latin capital letter Y with grave |
[1534] Fix | Delete
* | U+1EF3 | ỳ | y | Latin small letter y with grave |
[1535] Fix | Delete
* | U+1EF4 | Ỵ | Y | Latin capital letter Y with dot below |
[1536] Fix | Delete
* | U+1EF5 | ỵ | y | Latin small letter y with dot below |
[1537] Fix | Delete
* | U+1EF6 | Ỷ | Y | Latin capital letter Y with hook above |
[1538] Fix | Delete
* | U+1EF7 | ỷ | y | Latin small letter y with hook above |
[1539] Fix | Delete
* | U+1EF8 | Ỹ | Y | Latin capital letter Y with tilde |
[1540] Fix | Delete
* | U+1EF9 | ỹ | y | Latin small letter y with tilde |
[1541] Fix | Delete
*
[1542] Fix | Delete
* German (`de_DE`), German formal (`de_DE_formal`), German (Switzerland) formal (`de_CH`),
[1543] Fix | Delete
* German (Switzerland) informal (`de_CH_informal`), and German (Austria) (`de_AT`) locales:
[1544] Fix | Delete
*
[1545] Fix | Delete
* | Code | Glyph | Replacement | Description |
[1546] Fix | Delete
* | -------- | ----- | ----------- | --------------------------------------- |
[1547] Fix | Delete
* | U+00C4 | Ä | Ae | Latin capital letter A with diaeresis |
[1548] Fix | Delete
* | U+00E4 | ä | ae | Latin small letter a with diaeresis |
[1549] Fix | Delete
* | U+00D6 | Ö | Oe | Latin capital letter O with diaeresis |
[1550] Fix | Delete
* | U+00F6 | ö | oe | Latin small letter o with diaeresis |
[1551] Fix | Delete
* | U+00DC | Ü | Ue | Latin capital letter U with diaeresis |
[1552] Fix | Delete
* | U+00FC | ü | ue | Latin small letter u with diaeresis |
[1553] Fix | Delete
* | U+00DF | ß | ss | Latin small letter sharp s |
[1554] Fix | Delete
*
[1555] Fix | Delete
* Danish (`da_DK`) locale:
[1556] Fix | Delete
*
[1557] Fix | Delete
* | Code | Glyph | Replacement | Description |
[1558] Fix | Delete
* | -------- | ----- | ----------- | --------------------------------------- |
[1559] Fix | Delete
* | U+00C6 | Æ | Ae | Latin capital letter AE |
[1560] Fix | Delete
* | U+00E6 | æ | ae | Latin small letter ae |
[1561] Fix | Delete
* | U+00D8 | Ø | Oe | Latin capital letter O with stroke |
[1562] Fix | Delete
* | U+00F8 | ø | oe | Latin small letter o with stroke |
[1563] Fix | Delete
* | U+00C5 | Å | Aa | Latin capital letter A with ring above |
[1564] Fix | Delete
* | U+00E5 | å | aa | Latin small letter a with ring above |
[1565] Fix | Delete
*
[1566] Fix | Delete
* Catalan (`ca`) locale:
[1567] Fix | Delete
*
[1568] Fix | Delete
* | Code | Glyph | Replacement | Description |
[1569] Fix | Delete
* | -------- | ----- | ----------- | --------------------------------------- |
[1570] Fix | Delete
* | U+00B7 | l·l | ll | Flown dot (between two Ls) |
[1571] Fix | Delete
*
[1572] Fix | Delete
* Serbian (`sr_RS`) and Bosnian (`bs_BA`) locales:
[1573] Fix | Delete
*
[1574] Fix | Delete
* | Code | Glyph | Replacement | Description |
[1575] Fix | Delete
* | -------- | ----- | ----------- | --------------------------------------- |
[1576] Fix | Delete
* | U+0110 | Đ | DJ | Latin capital letter D with stroke |
[1577] Fix | Delete
* | U+0111 | đ | dj | Latin small letter d with stroke |
[1578] Fix | Delete
*
[1579] Fix | Delete
* @since 1.2.1
[1580] Fix | Delete
* @since 4.6.0 Added locale support for `de_CH`, `de_CH_informal`, and `ca`.
[1581] Fix | Delete
* @since 4.7.0 Added locale support for `sr_RS`.
[1582] Fix | Delete
* @since 4.8.0 Added locale support for `bs_BA`.
[1583] Fix | Delete
* @since 5.7.0 Added locale support for `de_AT`.
[1584] Fix | Delete
*
[1585] Fix | Delete
* @param string $string Text that might have accent characters
[1586] Fix | Delete
* @return string Filtered string with replaced "nice" characters.
[1587] Fix | Delete
*/
[1588] Fix | Delete
function remove_accents( $string ) {
[1589] Fix | Delete
if ( ! preg_match( '/[\x80-\xff]/', $string ) ) {
[1590] Fix | Delete
return $string;
[1591] Fix | Delete
}
[1592] Fix | Delete
[1593] Fix | Delete
if ( seems_utf8( $string ) ) {
[1594] Fix | Delete
$chars = array(
[1595] Fix | Delete
// Decompositions for Latin-1 Supplement.
[1596] Fix | Delete
'ª' => 'a',
[1597] Fix | Delete
'º' => 'o',
[1598] Fix | Delete
'À' => 'A',
[1599] Fix | Delete
'Á' => 'A',
[1600] Fix | Delete
'Â' => 'A',
[1601] Fix | Delete
'Ã' => 'A',
[1602] Fix | Delete
'Ä' => 'A',
[1603] Fix | Delete
'Å' => 'A',
[1604] Fix | Delete
'Æ' => 'AE',
[1605] Fix | Delete
'Ç' => 'C',
[1606] Fix | Delete
'È' => 'E',
[1607] Fix | Delete
'É' => 'E',
[1608] Fix | Delete
'Ê' => 'E',
[1609] Fix | Delete
'Ë' => 'E',
[1610] Fix | Delete
'Ì' => 'I',
[1611] Fix | Delete
'Í' => 'I',
[1612] Fix | Delete
'Î' => 'I',
[1613] Fix | Delete
'Ï' => 'I',
[1614] Fix | Delete
'Ð' => 'D',
[1615] Fix | Delete
'Ñ' => 'N',
[1616] Fix | Delete
'Ò' => 'O',
[1617] Fix | Delete
'Ó' => 'O',
[1618] Fix | Delete
'Ô' => 'O',
[1619] Fix | Delete
'Õ' => 'O',
[1620] Fix | Delete
'Ö' => 'O',
[1621] Fix | Delete
'Ù' => 'U',
[1622] Fix | Delete
'Ú' => 'U',
[1623] Fix | Delete
'Û' => 'U',
[1624] Fix | Delete
'Ü' => 'U',
[1625] Fix | Delete
'Ý' => 'Y',
[1626] Fix | Delete
'Þ' => 'TH',
[1627] Fix | Delete
'ß' => 's',
[1628] Fix | Delete
'à' => 'a',
[1629] Fix | Delete
'á' => 'a',
[1630] Fix | Delete
'â' => 'a',
[1631] Fix | Delete
'ã' => 'a',
[1632] Fix | Delete
'ä' => 'a',
[1633] Fix | Delete
'å' => 'a',
[1634] Fix | Delete
'æ' => 'ae',
[1635] Fix | Delete
'ç' => 'c',
[1636] Fix | Delete
'è' => 'e',
[1637] Fix | Delete
'é' => 'e',
[1638] Fix | Delete
'ê' => 'e',
[1639] Fix | Delete
'ë' => 'e',
[1640] Fix | Delete
'ì' => 'i',
[1641] Fix | Delete
'í' => 'i',
[1642] Fix | Delete
'î' => 'i',
[1643] Fix | Delete
'ï' => 'i',
[1644] Fix | Delete
'ð' => 'd',
[1645] Fix | Delete
'ñ' => 'n',
[1646] Fix | Delete
'ò' => 'o',
[1647] Fix | Delete
'ó' => 'o',
[1648] Fix | Delete
'ô' => 'o',
[1649] Fix | Delete
'õ' => 'o',
[1650] Fix | Delete
'ö' => 'o',
[1651] Fix | Delete
'ø' => 'o',
[1652] Fix | Delete
'ù' => 'u',
[1653] Fix | Delete
'ú' => 'u',
[1654] Fix | Delete
'û' => 'u',
[1655] Fix | Delete
'ü' => 'u',
[1656] Fix | Delete
'ý' => 'y',
[1657] Fix | Delete
'þ' => 'th',
[1658] Fix | Delete
'ÿ' => 'y',
[1659] Fix | Delete
'Ø' => 'O',
[1660] Fix | Delete
// Decompositions for Latin Extended-A.
[1661] Fix | Delete
'Ā' => 'A',
[1662] Fix | Delete
'ā' => 'a',
[1663] Fix | Delete
'Ă' => 'A',
[1664] Fix | Delete
'ă' => 'a',
[1665] Fix | Delete
'Ą' => 'A',
[1666] Fix | Delete
'ą' => 'a',
[1667] Fix | Delete
'Ć' => 'C',
[1668] Fix | Delete
'ć' => 'c',
[1669] Fix | Delete
'Ĉ' => 'C',
[1670] Fix | Delete
'ĉ' => 'c',
[1671] Fix | Delete
'Ċ' => 'C',
[1672] Fix | Delete
'ċ' => 'c',
[1673] Fix | Delete
'Č' => 'C',
[1674] Fix | Delete
'č' => 'c',
[1675] Fix | Delete
'Ď' => 'D',
[1676] Fix | Delete
'ď' => 'd',
[1677] Fix | Delete
'Đ' => 'D',
[1678] Fix | Delete
'đ' => 'd',
[1679] Fix | Delete
'Ē' => 'E',
[1680] Fix | Delete
'ē' => 'e',
[1681] Fix | Delete
'Ĕ' => 'E',
[1682] Fix | Delete
'ĕ' => 'e',
[1683] Fix | Delete
'Ė' => 'E',
[1684] Fix | Delete
'ė' => 'e',
[1685] Fix | Delete
'Ę' => 'E',
[1686] Fix | Delete
'ę' => 'e',
[1687] Fix | Delete
'Ě' => 'E',
[1688] Fix | Delete
'ě' => 'e',
[1689] Fix | Delete
'Ĝ' => 'G',
[1690] Fix | Delete
'ĝ' => 'g',
[1691] Fix | Delete
'Ğ' => 'G',
[1692] Fix | Delete
'ğ' => 'g',
[1693] Fix | Delete
'Ġ' => 'G',
[1694] Fix | Delete
'ġ' => 'g',
[1695] Fix | Delete
'Ģ' => 'G',
[1696] Fix | Delete
'ģ' => 'g',
[1697] Fix | Delete
'Ĥ' => 'H',
[1698] Fix | Delete
'ĥ' => 'h',
[1699] Fix | Delete
'Ħ' => 'H',
[1700] Fix | Delete
'ħ' => 'h',
[1701] Fix | Delete
'Ĩ' => 'I',
[1702] Fix | Delete
'ĩ' => 'i',
[1703] Fix | Delete
'Ī' => 'I',
[1704] Fix | Delete
'ī' => 'i',
[1705] Fix | Delete
'Ĭ' => 'I',
[1706] Fix | Delete
'ĭ' => 'i',
[1707] Fix | Delete
'Į' => 'I',
[1708] Fix | Delete
'į' => 'i',
[1709] Fix | Delete
'İ' => 'I',
[1710] Fix | Delete
'ı' => 'i',
[1711] Fix | Delete
'IJ' => 'IJ',
[1712] Fix | Delete
'ij' => 'ij',
[1713] Fix | Delete
'Ĵ' => 'J',
[1714] Fix | Delete
'ĵ' => 'j',
[1715] Fix | Delete
'Ķ' => 'K',
[1716] Fix | Delete
'ķ' => 'k',
[1717] Fix | Delete
'ĸ' => 'k',
[1718] Fix | Delete
'Ĺ' => 'L',
[1719] Fix | Delete
'ĺ' => 'l',
[1720] Fix | Delete
'Ļ' => 'L',
[1721] Fix | Delete
'ļ' => 'l',
[1722] Fix | Delete
'Ľ' => 'L',
[1723] Fix | Delete
'ľ' => 'l',
[1724] Fix | Delete
'Ŀ' => 'L',
[1725] Fix | Delete
'ŀ' => 'l',
[1726] Fix | Delete
'Ł' => 'L',
[1727] Fix | Delete
'ł' => 'l',
[1728] Fix | Delete
'Ń' => 'N',
[1729] Fix | Delete
'ń' => 'n',
[1730] Fix | Delete
'Ņ' => 'N',
[1731] Fix | Delete
'ņ' => 'n',
[1732] Fix | Delete
'Ň' => 'N',
[1733] Fix | Delete
'ň' => 'n',
[1734] Fix | Delete
'ʼn' => 'n',
[1735] Fix | Delete
'Ŋ' => 'N',
[1736] Fix | Delete
'ŋ' => 'n',
[1737] Fix | Delete
'Ō' => 'O',
[1738] Fix | Delete
'ō' => 'o',
[1739] Fix | Delete
'Ŏ' => 'O',
[1740] Fix | Delete
'ŏ' => 'o',
[1741] Fix | Delete
'Ő' => 'O',
[1742] Fix | Delete
'ő' => 'o',
[1743] Fix | Delete
'Œ' => 'OE',
[1744] Fix | Delete
'œ' => 'oe',
[1745] Fix | Delete
'Ŕ' => 'R',
[1746] Fix | Delete
'ŕ' => 'r',
[1747] Fix | Delete
'Ŗ' => 'R',
[1748] Fix | Delete
'ŗ' => 'r',
[1749] Fix | Delete
'Ř' => 'R',
[1750] Fix | Delete
'ř' => 'r',
[1751] Fix | Delete
'Ś' => 'S',
[1752] Fix | Delete
'ś' => 's',
[1753] Fix | Delete
'Ŝ' => 'S',
[1754] Fix | Delete
'ŝ' => 's',
[1755] Fix | Delete
'Ş' => 'S',
[1756] Fix | Delete
'ş' => 's',
[1757] Fix | Delete
'Š' => 'S',
[1758] Fix | Delete
'š' => 's',
[1759] Fix | Delete
'Ţ' => 'T',
[1760] Fix | Delete
'ţ' => 't',
[1761] Fix | Delete
'Ť' => 'T',
[1762] Fix | Delete
'ť' => 't',
[1763] Fix | Delete
'Ŧ' => 'T',
[1764] Fix | Delete
'ŧ' => 't',
[1765] Fix | Delete
'Ũ' => 'U',
[1766] Fix | Delete
'ũ' => 'u',
[1767] Fix | Delete
'Ū' => 'U',
[1768] Fix | Delete
'ū' => 'u',
[1769] Fix | Delete
'Ŭ' => 'U',
[1770] Fix | Delete
'ŭ' => 'u',
[1771] Fix | Delete
'Ů' => 'U',
[1772] Fix | Delete
'ů' => 'u',
[1773] Fix | Delete
'Ű' => 'U',
[1774] Fix | Delete
'ű' => 'u',
[1775] Fix | Delete
'Ų' => 'U',
[1776] Fix | Delete
'ų' => 'u',
[1777] Fix | Delete
'Ŵ' => 'W',
[1778] Fix | Delete
'ŵ' => 'w',
[1779] Fix | Delete
'Ŷ' => 'Y',
[1780] Fix | Delete
'ŷ' => 'y',
[1781] Fix | Delete
'Ÿ' => 'Y',
[1782] Fix | Delete
'Ź' => 'Z',
[1783] Fix | Delete
'ź' => 'z',
[1784] Fix | Delete
'Ż' => 'Z',
[1785] Fix | Delete
'ż' => 'z',
[1786] Fix | Delete
'Ž' => 'Z',
[1787] Fix | Delete
'ž' => 'z',
[1788] Fix | Delete
'ſ' => 's',
[1789] Fix | Delete
// Decompositions for Latin Extended-B.
[1790] Fix | Delete
'Ș' => 'S',
[1791] Fix | Delete
'ș' => 's',
[1792] Fix | Delete
'Ț' => 'T',
[1793] Fix | Delete
'ț' => 't',
[1794] Fix | Delete
// Euro sign.
[1795] Fix | Delete
'€' => 'E',
[1796] Fix | Delete
// GBP (Pound) sign.
[1797] Fix | Delete
'£' => '',
[1798] Fix | Delete
// Vowels with diacritic (Vietnamese).
[1799] Fix | Delete
// Unmarked.
[1800] Fix | Delete
'Ơ' => 'O',
[1801] Fix | Delete
'ơ' => 'o',
[1802] Fix | Delete
'Ư' => 'U',
[1803] Fix | Delete
'ư' => 'u',
[1804] Fix | Delete
// Grave accent.
[1805] Fix | Delete
'Ầ' => 'A',
[1806] Fix | Delete
'ầ' => 'a',
[1807] Fix | Delete
'Ằ' => 'A',
[1808] Fix | Delete
'ằ' => 'a',
[1809] Fix | Delete
'Ề' => 'E',
[1810] Fix | Delete
'ề' => 'e',
[1811] Fix | Delete
'Ồ' => 'O',
[1812] Fix | Delete
'ồ' => 'o',
[1813] Fix | Delete
'Ờ' => 'O',
[1814] Fix | Delete
'ờ' => 'o',
[1815] Fix | Delete
'Ừ' => 'U',
[1816] Fix | Delete
'ừ' => 'u',
[1817] Fix | Delete
'Ỳ' => 'Y',
[1818] Fix | Delete
'ỳ' => 'y',
[1819] Fix | Delete
// Hook.
[1820] Fix | Delete
'Ả' => 'A',
[1821] Fix | Delete
'ả' => 'a',
[1822] Fix | Delete
'Ẩ' => 'A',
[1823] Fix | Delete
'ẩ' => 'a',
[1824] Fix | Delete
'Ẳ' => 'A',
[1825] Fix | Delete
'ẳ' => 'a',
[1826] Fix | Delete
'Ẻ' => 'E',
[1827] Fix | Delete
'ẻ' => 'e',
[1828] Fix | Delete
'Ể' => 'E',
[1829] Fix | Delete
'ể' => 'e',
[1830] Fix | Delete
'Ỉ' => 'I',
[1831] Fix | Delete
'ỉ' => 'i',
[1832] Fix | Delete
'Ỏ' => 'O',
[1833] Fix | Delete
'ỏ' => 'o',
[1834] Fix | Delete
'Ổ' => 'O',
[1835] Fix | Delete
'ổ' => 'o',
[1836] Fix | Delete
'Ở' => 'O',
[1837] Fix | Delete
'ở' => 'o',
[1838] Fix | Delete
'Ủ' => 'U',
[1839] Fix | Delete
'ủ' => 'u',
[1840] Fix | Delete
'Ử' => 'U',
[1841] Fix | Delete
'ử' => 'u',
[1842] Fix | Delete
'Ỷ' => 'Y',
[1843] Fix | Delete
'ỷ' => 'y',
[1844] Fix | Delete
// Tilde.
[1845] Fix | Delete
'Ẫ' => 'A',
[1846] Fix | Delete
'ẫ' => 'a',
[1847] Fix | Delete
'Ẵ' => 'A',
[1848] Fix | Delete
'ẵ' => 'a',
[1849] Fix | Delete
'Ẽ' => 'E',
[1850] Fix | Delete
'ẽ' => 'e',
[1851] Fix | Delete
'Ễ' => 'E',
[1852] Fix | Delete
'ễ' => 'e',
[1853] Fix | Delete
'Ỗ' => 'O',
[1854] Fix | Delete
'ỗ' => 'o',
[1855] Fix | Delete
'Ỡ' => 'O',
[1856] Fix | Delete
'ỡ' => 'o',
[1857] Fix | Delete
'Ữ' => 'U',
[1858] Fix | Delete
'ữ' => 'u',
[1859] Fix | Delete
'Ỹ' => 'Y',
[1860] Fix | Delete
'ỹ' => 'y',
[1861] Fix | Delete
// Acute accent.
[1862] Fix | Delete
'Ấ' => 'A',
[1863] Fix | Delete
'ấ' => 'a',
[1864] Fix | Delete
'Ắ' => 'A',
[1865] Fix | Delete
'ắ' => 'a',
[1866] Fix | Delete
'Ế' => 'E',
[1867] Fix | Delete
'ế' => 'e',
[1868] Fix | Delete
'Ố' => 'O',
[1869] Fix | Delete
'ố' => 'o',
[1870] Fix | Delete
'Ớ' => 'O',
[1871] Fix | Delete
'ớ' => 'o',
[1872] Fix | Delete
'Ứ' => 'U',
[1873] Fix | Delete
'ứ' => 'u',
[1874] Fix | Delete
// Dot below.
[1875] Fix | Delete
'Ạ' => 'A',
[1876] Fix | Delete
'ạ' => 'a',
[1877] Fix | Delete
'Ậ' => 'A',
[1878] Fix | Delete
'ậ' => 'a',
[1879] Fix | Delete
'Ặ' => 'A',
[1880] Fix | Delete
'ặ' => 'a',
[1881] Fix | Delete
'Ẹ' => 'E',
[1882] Fix | Delete
'ẹ' => 'e',
[1883] Fix | Delete
'Ệ' => 'E',
[1884] Fix | Delete
'ệ' => 'e',
[1885] Fix | Delete
'Ị' => 'I',
[1886] Fix | Delete
'ị' => 'i',
[1887] Fix | Delete
'Ọ' => 'O',
[1888] Fix | Delete
'ọ' => 'o',
[1889] Fix | Delete
'Ộ' => 'O',
[1890] Fix | Delete
'ộ' => 'o',
[1891] Fix | Delete
'Ợ' => 'O',
[1892] Fix | Delete
'ợ' => 'o',
[1893] Fix | Delete
'Ụ' => 'U',
[1894] Fix | Delete
'ụ' => 'u',
[1895] Fix | Delete
'Ự' => 'U',
[1896] Fix | Delete
'ự' => 'u',
[1897] Fix | Delete
'Ỵ' => 'Y',
[1898] Fix | Delete
'ỵ' => 'y',
[1899] Fix | Delete
// Vowels with diacritic (Chinese, Hanyu Pinyin).
[1900] Fix | Delete
'ɑ' => 'a',
[1901] Fix | Delete
// Macron.
[1902] Fix | Delete
'Ǖ' => 'U',
[1903] Fix | Delete
'ǖ' => 'u',
[1904] Fix | Delete
// Acute accent.
[1905] Fix | Delete
'Ǘ' => 'U',
[1906] Fix | Delete
'ǘ' => 'u',
[1907] Fix | Delete
// Caron.
[1908] Fix | Delete
'Ǎ' => 'A',
[1909] Fix | Delete
'ǎ' => 'a',
[1910] Fix | Delete
'Ǐ' => 'I',
[1911] Fix | Delete
'ǐ' => 'i',
[1912] Fix | Delete
'Ǒ' => 'O',
[1913] Fix | Delete
'ǒ' => 'o',
[1914] Fix | Delete
'Ǔ' => 'U',
[1915] Fix | Delete
'ǔ' => 'u',
[1916] Fix | Delete
'Ǚ' => 'U',
[1917] Fix | Delete
'ǚ' => 'u',
[1918] Fix | Delete
// Grave accent.
[1919] Fix | Delete
'Ǜ' => 'U',
[1920] Fix | Delete
'ǜ' => 'u',
[1921] Fix | Delete
);
[1922] Fix | Delete
[1923] Fix | Delete
// Used for locale-specific rules.
[1924] Fix | Delete
$locale = get_locale();
[1925] Fix | Delete
[1926] Fix | Delete
if ( in_array( $locale, array( 'de_DE', 'de_DE_formal', 'de_CH', 'de_CH_informal', 'de_AT' ), true ) ) {
[1927] Fix | Delete
$chars['Ä'] = 'Ae';
[1928] Fix | Delete
$chars['ä'] = 'ae';
[1929] Fix | Delete
$chars['Ö'] = 'Oe';
[1930] Fix | Delete
$chars['ö'] = 'oe';
[1931] Fix | Delete
$chars['Ü'] = 'Ue';
[1932] Fix | Delete
$chars['ü'] = 'ue';
[1933] Fix | Delete
$chars['ß'] = 'ss';
[1934] Fix | Delete
} elseif ( 'da_DK' === $locale ) {
[1935] Fix | Delete
$chars['Æ'] = 'Ae';
[1936] Fix | Delete
$chars['æ'] = 'ae';
[1937] Fix | Delete
$chars['Ø'] = 'Oe';
[1938] Fix | Delete
$chars['ø'] = 'oe';
[1939] Fix | Delete
$chars['Å'] = 'Aa';
[1940] Fix | Delete
$chars['å'] = 'aa';
[1941] Fix | Delete
} elseif ( 'ca' === $locale ) {
[1942] Fix | Delete
$chars['l·l'] = 'll';
[1943] Fix | Delete
} elseif ( 'sr_RS' === $locale || 'bs_BA' === $locale ) {
[1944] Fix | Delete
$chars['Đ'] = 'DJ';
[1945] Fix | Delete
$chars['đ'] = 'dj';
[1946] Fix | Delete
}
[1947] Fix | Delete
[1948] Fix | Delete
$string = strtr( $string, $chars );
[1949] Fix | Delete
} else {
[1950] Fix | Delete
$chars = array();
[1951] Fix | Delete
// Assume ISO-8859-1 if not UTF-8.
[1952] Fix | Delete
$chars['in'] = "\x80\x83\x8a\x8e\x9a\x9e"
[1953] Fix | Delete
. "\x9f\xa2\xa5\xb5\xc0\xc1\xc2"
[1954] Fix | Delete
. "\xc3\xc4\xc5\xc7\xc8\xc9\xca"
[1955] Fix | Delete
. "\xcb\xcc\xcd\xce\xcf\xd1\xd2"
[1956] Fix | Delete
. "\xd3\xd4\xd5\xd6\xd8\xd9\xda"
[1957] Fix | Delete
. "\xdb\xdc\xdd\xe0\xe1\xe2\xe3"
[1958] Fix | Delete
. "\xe4\xe5\xe7\xe8\xe9\xea\xeb"
[1959] Fix | Delete
. "\xec\xed\xee\xef\xf1\xf2\xf3"
[1960] Fix | Delete
. "\xf4\xf5\xf6\xf8\xf9\xfa\xfb"
[1961] Fix | Delete
. "\xfc\xfd\xff";
[1962] Fix | Delete
[1963] Fix | Delete
$chars['out'] = 'EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy';
[1964] Fix | Delete
[1965] Fix | Delete
$string = strtr( $string, $chars['in'], $chars['out'] );
[1966] Fix | Delete
$double_chars = array();
[1967] Fix | Delete
$double_chars['in'] = array( "\x8c", "\x9c", "\xc6", "\xd0", "\xde", "\xdf", "\xe6", "\xf0", "\xfe" );
[1968] Fix | Delete
$double_chars['out'] = array( 'OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th' );
[1969] Fix | Delete
$string = str_replace( $double_chars['in'], $double_chars['out'], $string );
[1970] Fix | Delete
}
[1971] Fix | Delete
[1972] Fix | Delete
return $string;
[1973] Fix | Delete
}
[1974] Fix | Delete
[1975] Fix | Delete
/**
[1976] Fix | Delete
* Sanitizes a filename, replacing whitespace with dashes.
[1977] Fix | Delete
*
[1978] Fix | Delete
* Removes special characters that are illegal in filenames on certain
[1979] Fix | Delete
* operating systems and special characters requiring special escaping
[1980] Fix | Delete
* to manipulate at the command line. Replaces spaces and consecutive
[1981] Fix | Delete
* dashes with a single dash. Trims period, dash and underscore from beginning
[1982] Fix | Delete
* and end of filename. It is not guaranteed that this function will return a
[1983] Fix | Delete
* filename that is allowed to be uploaded.
[1984] Fix | Delete
*
[1985] Fix | Delete
* @since 2.1.0
[1986] Fix | Delete
*
[1987] Fix | Delete
* @param string $filename The filename to be sanitized.
[1988] Fix | Delete
* @return string The sanitized filename.
[1989] Fix | Delete
*/
[1990] Fix | Delete
function sanitize_file_name( $filename ) {
[1991] Fix | Delete
$filename_raw = $filename;
[1992] Fix | Delete
$filename = remove_accents( $filename );
[1993] Fix | Delete
[1994] Fix | Delete
$special_chars = array( '?', '[', ']', '/', '\\', '=', '<', '>', ':', ';', ',', "'", '"', '&', '$', '#', '*', '(', ')', '|', '~', '`', '!', '{', '}', '%', '+', '’', '«', '»', '”', '“', chr( 0 ) );
[1995] Fix | Delete
[1996] Fix | Delete
// Check for support for utf8 in the installed PCRE library once and store the result in a static.
[1997] Fix | Delete
static $utf8_pcre = null;
[1998] Fix | Delete
if ( ! isset( $utf8_pcre ) ) {
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function