31
Ekim
Plogger 3.0 Beta - Albüm klasör isimlerindeki türkçe karakter hataları
Webalbüm, foto galeri, plogger 3.0, script, türkçe karakter
Daha önceleri Plogger Fotoğraf Galerisinin kurulumuna yer vermiştim ve klasör isimlerinde türkçe karakter hatası olduğunu belirtmiştim.Hakan abimiz yememiş içmemiş güzel bir fonksiyon hazırlamış.Buradan teşekkürlerimi iletiyorum.
Yamanın uygulanması
plog-functions.php dosyasını açıyorsunuz.
PHP:
-
function sanitize_filename($str) {
-
// allow only alphanumeric characters, hyphen, [, ], dot and apostrophe in file names
-
// the rest will be replaced
-
}
Yukarıdaki kodları buluyor ve,
PHP:
-
/*
-
function sanitize_filename($str) {
-
// allow only alphanumeric characters, hyphen, [, ], dot and apostrophe in file names
-
// the rest will be replaced
-
return preg_replace("/[^\w|\.|'|\-|\[|\]]/","_",$str);
-
}
-
*/
olarak değiştiriyorsunuz.
Daha sonra plog-functions.php dosyasının en sonuna ve ?> satırından önce alttaki satırları ekliyorsunuz.
PHP:
-
/* Fix for sanitize_filename , Hakan Demiray - http://www.dmry.net */
-
function sanitize_filename($title) {
-
// Preserve escaped octets.
-
// Remove percent signs that are not part of an octet.
-
// Restore octets.
-
$title = plog_remove_accents($title);
-
if (plog_seems_utf8($title)) {
-
}
-
$title = plog_utf8_uri_encode($title, 200);
-
}
-
return $title;
-
}
-
function plog_remove_accents($string) {
-
return $string;
-
if (plog_seems_utf8($string)) {
-
// Decompositions for Latin-1 Supplement
-
// Decompositions for Latin Extended-A