function ___wejns_wp_whitespace_fix($input) {
/* valid content-type? */
$allowed = false;
/* found content-type header? */
$found = false;
/* we mangle the output if (and only if) output type is text/* */
foreach (headers_list() as $header) {
if (preg_match("/^content-type:\\s+(text\\/|application\\/((xhtml|atom|rss)\\+xml|xml))/i", $header)) {
$allowed = true;
}
if (preg_match("/^content-type:\\s+/i", $header)) {
$found = true;
}
}
/* do the actual work */
if ($allowed || !$found) {
return preg_replace("/\\A\\s*/m", "", $input);
} else {
return $input;
}
}
/* start output buffering using custom callback */
ob_start("___wejns_wp_whitespace_fix");Çıkıyor.. bu preg_match fonksiyonlu bu kodların anlamını tahmin edebiliyorum fakat tam olarak bu kodların ne işe yaradığını bilen var mı?
WP dosyalarımda bilinmeyen kodlar var
2
●104
- 31-12-2022, 11:37:56WP dizinime baktığımda fix.php diye bir dosya gördüm. Açtığımda karşıma;
- 31-12-2022, 11:41:54Hocam whitespace denilen, bir klavye karşılığı olan ama ekranda görünmeyen karakterleri temizliyor.
Bknz: https://wejn.org/stuff/wejnswpwhitespacefix.php.html