Po upgrade na 1.5.2 dalej ten sam problem.
Jednak już ogarnąłem temat, posiłkowałem się kodem z 1.3.1: zmiany dotyczą kodu w /js/admin.js
Zamiana z:
function str2url(str,encoding,ucfirst)
{
str = str.toUpperCase();
str = str.toLowerCase();
str = str.replace(/[^a-z0-9\s\'\:\/\[\]-]\\u00A1-\\uFFFF/g,'');
str = str.replace(/[\u0028\u0029\u0021\u003F\u002E\u0026\u005E\u007E\u002B\u002A\u002F\u003A\u003B\u003C\u003D\u003E]/g,'');
str = str.replace(/[\s\'\:\/\[\]-]+/g,' ');
// Add special char not used for url rewrite
str = str.replace(/[ ]/g, '-');
str = str.replace(/[\/\\"'|,;]*/g, '');
if (ucfirst == 1) {
var first_char = str.charAt(0);
str = first_char.toUpperCase()+str.slice(1);
}
return str;
}
Na:
function str2url(str,encoding,ucfirst)
{
str = str.toUpperCase();
str = str.toLowerCase();
str = str.replace(/[\u0105\u0104\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5]/g,'a');
str = str.replace(/[\u00E7\u010D\u0107\u0106]/g,'c');
str = str.replace(/[\u010F]/g,'d');
str = str.replace(/[\u00E8\u00E9\u00EA\u00EB\u011B\u0119\u0118]/g,'e');
str = str.replace(/[\u00EC\u00ED\u00EE\u00EF]/g,'i');
str = str.replace(/[\u0142\u0141]/g,'l');
str = str.replace(/[\u00F1\u0148]/g,'n');
str = str.replace(/[\u00F2\u00F3\u00F4\u00F5\u00F6\u00F8\u00D3]/g,'o');
str = str.replace(/[\u0159]/g,'r');
str = str.replace(/[\u015B\u015A\u0161]/g,'s');
str = str.replace(/[\u00DF]/g,'ss');
str = str.replace(/[\u0165]/g,'t');
str = str.replace(/[\u00F9\u00FA\u00FB\u00FC\u016F]/g,'u');
str = str.replace(/[\u00FD\u00FF]/g,'y');
str = str.replace(/[\u017C\u017A\u017B\u0179\u017E]/g,'z');
str = str.replace(/[\u00E6]/g,'ae');
str = str.replace(/[\u0153]/g,'oe');
str = str.replace(/[\u013E\u013A]/g,'l');
str = str.replace(/[\u0155]/g,'r');
str = str.replace(/[^a-z0-9\s\'\:\/\[\]-]/g,'');
str = str.replace(/[\s\'\:\/\[\]-]+/g,' ');
str = str.replace(/[ ]/g,'-');
str = str.replace(/[\/]/g,'-');
if (ucfirst == 1) {
c = str.charAt(0);
str = c.toUpperCase()+str.slice(1);
}
return str;
}
Oraz zmiana:
function copy2friendlyURL()
{
$('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8').replace('%', ''));
if ($('#friendly-url'))
$('#friendly-url').html($('#link_rewrite_' + id_language).val());
// trigger onchange event to use anything binded there
$('#link_rewrite_' + id_language).change();
return;
}
Na:
function copy2friendlyURL()
{
$('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8'));
}
Po tym zabiegu automatycznie już generują się przyjazne URL bez polskich znaków.