Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Skrypt nie działa na hostingu,choć powinien?!?
Forum PHP.pl > Forum > Przedszkole
lulia
Witam napisałam klasę odpowiadaj±c± za walidację danych wej¶ciowych pod Symfony. I wszystko fajnie, uruchamiany na dwóch serwach z ubuntu i php 7.Smiga aż miło,ale ....
Na serwerze produkcyjnym już nie sad.gif Może mi kto¶ wytkn±ć błedy i powód.Albo pokazać gdzie jest bł±d,a ja go nie widzę.

  1. class ValidationClass
  2. {
  3.  
  4. public function removeWhiteChars($string)
  5. {
  6. $this->string=trim($string);
  7. return $this->string;
  8. }
  9. public function stringFilter($string,$filter)
  10. {
  11. switch ($filter)
  12. {
  13. case "int":
  14. return preg_replace("/[^0-9]/","",$string);
  15. case "char":
  16. return preg_replace("/[^A-Za-z?![:space:]]/","",$string);
  17. case "char_nospace":
  18. return preg_replace("/[^A-Za-z]/","",$string);
  19. case "char_pl":
  20. return preg_replace("/[^A-Za-zˇĘÓŁ¦Ż¬ĆŃ?![:space:]\?\!,.]/","",$string);
  21. case "all":
  22. return preg_replace("/[^0-9A-Za-zę󳶱漿ńˇĘÓŁ\/¦Ż¬\\\\ĆŃ?![:space:]\?\@!,#_.+-]/","",$string);
  23. case "date":
  24. return preg_replace("/[^0-9\/,.\\\\]/","",$string);
  25. }
  26.  
  27.  
  28. }
  29.  
  30. public function lengthControl($string,$min,$max)
  31. {
  32.  
  33. if($this->lengthControlEncoding($string, "auto") <= $max && $this->lengthControlEncoding($string, "auto") >= $min)
  34. {
  35. return true;
  36. } else
  37. {
  38. return FALSE;
  39. }
  40.  
  41. }
  42. public function showEncoding($string)
  43. {
  44. return mb_detect_encoding($string, "auto");
  45. }
  46. public function lengthControlEncoding($string,$encoding)
  47. {
  48. return mb_strlen($string, $encoding);
  49. }
  50. public function generalControl($string,$minL,$maxL,$generalFilter)
  51. {
  52. $this->removeWC=$this->removeWhiteChars($string);
  53. $this->preg=$this->stringFilter($this->removeWC,$generalFilter);
  54. $this->clear=$this->lengthControl($this->preg,$minL,$maxL);
  55. if($this->clear == true)
  56. {
  57. return $this->preg;
  58. }
  59. else
  60. {
  61. return null;
  62. }
  63.  
  64. }
  65. public function generalControlExit($string,$minL,$maxL,$generalFilter)
  66. {
  67. $this->removeWC=$this->removeWhiteChars($string);
  68. $this->preg=$this->stringFilter($this->removeWC,$generalFilter);
  69. $this->clear=$this->lengthControl($this->preg,$minL,$maxL);
  70. if($this->clear == true)
  71. {
  72. return $this->preg;
  73. }
  74.  
  75.  
  76. }
  77.  
  78. public function verificationWithoutDelete($string)
  79. {
  80. $this->str = mb_convert_encoding($string, 'UTF-8', 'UTF-8');
  81. $this->str = htmlentities($this->str, ENT_QUOTES, 'UTF-8');
  82.  
  83. return $this->str;
  84. }
  85.  
  86. }
  87.  
Pyton_000
A może Ty nam pokażesz błędy z logów.

Sama klasa strasznie kuje w oczy...
lulia
niestety nie mam dostępu do logów sad.gif
ale problem powstaje tylko w funkcjach lengthControl oraz showEncoding
viking
Zmień error_reporting oraz flagę display_errors. Może nie ma rozszerzenia mb?
lulia
Nerwy mi pu¶ciły z supportem hostngu nie szło się dogadać. Po zmianie hostngu na inny wszystko bangla.
Widocznie co¶ tam nie było doinstalowane.
To jest wersja lo-fi głównej zawarto¶ci. Aby zobaczyć pełn± wersję z większ± zawarto¶ci±, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.