• 31-12-2022, 11:37:56
    #1
    WP dizinime baktığımda fix.php diye bir dosya gördüm. Açtığımda karşıma;
    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ı?
  • 31-12-2022, 11:41:54
    #2
    Software Developer
    Hocam whitespace denilen, bir klavye karşılığı olan ama ekranda görünmeyen karakterleri temizliyor.

    Bknz: https://wejn.org/stuff/wejnswpwhitespacefix.php.html
  • 31-12-2022, 11:43:44
    #3
    Draco adlı üyeden alıntı: mesajı görüntüle
    Hocam whitespace denilen, bir klavye karşılığı olan ama ekranda görünmeyen karakterleri temizliyor.

    Bknz: https://wejn.org/stuff/wejnswpwhitespacefix.php.html
    Çok teşekkürler