Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16287 | Rev 16766 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 16287 Rev 16747
Línea 668... Línea 668...
668
    {
668
    {
669
        $str = strtolower($str);
669
        $str = strtolower($str);
670
        $str = trim($str);
670
        $str = trim($str);
671
        $str = strip_tags($str);
671
        $str = strip_tags($str);
672
        $str = preg_replace('/[\r\n\t ]+/', ' ', $str);
672
        $str = preg_replace('/[\r\n\t ]+/', ' ', $str);
673
        $str = preg_replace('/[\"\*\/\:\<\>\?\'\|\,]+/', ' ', $str);
673
        $str = preg_replace('/[\#\"\*\/\:\<\>\?\'\|\,]+/', ' ', $str);
674
        $str = strtolower($str);
674
        $str = strtolower($str);
675
        $str = html_entity_decode($str, ENT_QUOTES, "utf-8");
675
        $str = html_entity_decode($str, ENT_QUOTES, "utf-8");
676
        $str = htmlentities($str, ENT_QUOTES, "utf-8");
676
        $str = htmlentities($str, ENT_QUOTES, "utf-8");
677
        $str = preg_replace("/(&)([a-z])([a-z]+;)/i", '$2', $str);
677
        $str = preg_replace("/(&)([a-z])([a-z]+;)/i", '$2', $str);
678
        $str = str_replace(' ', '-', $str);
678
        $str = str_replace(' ', '-', $str);
679
        $str = rawurlencode($str);
679
        $str = rawurlencode($str);
680
        $str = str_replace('%', '-', $str);
680
        $str = str_replace('%', '-', $str);
-
 
681
        $str = str_replace(['-----', '----', '---','--'], '-', $str);
681
        return trim(strtolower($str));
682
        return trim(strtolower($str));
682
    }
683
    }
Línea 683... Línea 684...
683
 
684
 
684
    public static function normalizeStringFilename($str = '')
685
    public static function normalizeStringFilename($str = '')
Línea 690... Línea 691...
690
 
691
 
Línea 691... Línea 692...
691
        $str = $basename . $extension;
692
        $str = $basename . $extension;
692
 
693
 
693
        $str = strip_tags($str);
694
        $str = strip_tags($str);
694
        $str = preg_replace('/[\r\n\t ]+/', ' ', $str);
695
        $str = preg_replace('/[\r\n\t ]+/', ' ', $str);
695
        $str = preg_replace('/[\"\*\/\:\<\>\?\'\|\,]+/', ' ', $str);
696
        $str = preg_replace('/[\#\"\*\/\:\<\>\?\'\|\,]+/', ' ', $str);
696
        $str = strtolower($str);
697
        $str = strtolower($str);
697
        $str = html_entity_decode($str, ENT_QUOTES, "utf-8");
698
        $str = html_entity_decode($str, ENT_QUOTES, "utf-8");
698
        $str = htmlentities($str, ENT_QUOTES, "utf-8");
699
        $str = htmlentities($str, ENT_QUOTES, "utf-8");