Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 307 Rev 334
Línea 572... Línea 572...
572
                $message_filename       = '';
572
                $message_filename       = '';
Línea 573... Línea 573...
573
 
573
 
574
 
574
 
575
                if (isset($files['file']) && empty($files['file']['error'])) {
575
                if (isset($files['file']) && empty($files['file']['error'])) {
Línea 576... Línea 576...
576
                    $message_tmp_filename  = $files['file']['tmp_name'];
576
                    $message_tmp_filename  = $files['file']['tmp_name'];
Línea 577... Línea 577...
577
                    $message_filename      = $this->normalizeString($files['file']['name']);
577
                    $message_filename      = \LeadersLinked\Library\Functions::normalizeStringFilename($files['file']['name']);
Línea 769... Línea 769...
769
        }
769
        }
770
    }
770
    }
Línea 771... Línea -...
771
 
-
 
772
 
-
 
773
 
-
 
774
    private function normalizeString($str = '')
-
 
775
    {
-
 
776
        $basename  = substr($str, 0, strrpos($str, '.'));
-
 
777
        $basename  = str_replace('.', '-', $basename);
-
 
778
 
-
 
779
        $extension  = substr($str, strrpos($str, '.'));
-
 
780
 
-
 
781
        $str = $basename . $extension;
-
 
782
 
-
 
783
        $str = strip_tags($str);
-
 
784
        $str = preg_replace('/[\r\n\t ]+/', ' ', $str);
-
 
785
        $str = preg_replace('/[\"\*\/\:\<\>\?\'\|\,]+/', ' ', $str);
-
 
786
        $str = strtolower($str);
-
 
787
        $str = html_entity_decode($str, ENT_QUOTES, "utf-8");
-
 
788
        $str = htmlentities($str, ENT_QUOTES, "utf-8");
-
 
789
        $str = preg_replace("/(&)([a-z])([a-z]+;)/i", '$2', $str);
-
 
790
        $str = str_replace(' ', '-', $str);
-
 
791
        $str = rawurlencode($str);
-
 
792
        $str = str_replace('%', '-', $str);
-
 
793
        return trim(strtolower($str));
771
 
794
    }
772
 
795
 
773
 
796
    /**
774
    /**
797
     *
775
     *