Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Naprawa błędu w dodawaniu strony, PHP, Smarty
Maker5
post 17.07.2019, 11:42:05
Post #1





Grupa: Zarejestrowani
Postów: 139
Pomógł: 0
Dołączył: 2.04.2008

Ostrzeżenie: (0%)
-----


Witam

Mam problem z moim panelem CMS.

Błąd polega na tym, że w trakcie dodawania nowej podstrony na stronie internetowej poprzez panel CMS

i kliknięcia zapisz pojawia się biała strona zamiast dodawać nową podstronę na stronę internetową.

Panel oparty o PHP Smarty.

Poniżej screeny pokazujące o co chodzi.

http://prnt.sc/og82qt
http://prnt.sc/og830p
http://prnt.sc/og859i

Ten post edytował Maker5 17.07.2019, 11:45:53
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Maker5
post 17.07.2019, 16:06:39
Post #2





Grupa: Zarejestrowani
Postów: 139
Pomógł: 0
Dołączył: 2.04.2008

Ostrzeżenie: (0%)
-----


Cytat(nospor @ 17.07.2019, 17:04:06 ) *
Dobrzy by zobaczyc co zawiera zmienna $pattern. Da sie?


jesli to w tym samym pliku to kod poniżej

  1. /**
  2.  * Method to sanitize incoming html.
  3.  * Take from cakephp (http://cakephp.org)
  4.  * Licensed under the MIT License
  5.  *
  6.  * @param unknown_type $string
  7.  * @param unknown_type $remove
  8.  * @return unknown
  9.  */
  10. function clean_html($string, $remove = false) {
  11. if ($remove) {
  12. $string = strip_tags($string);
  13. } else {
  14. $patterns = array("/\&/", "/%/", "/</", "/>/", '/"/', "/'/", "/\(/", "/\)/", "/\+/", "/-/");
  15. $replacements = array("&amp;", "%", "&lt;", "&gt;", "&quot;", "'", "(", ")", "+", "-");
  16. $string = preg_replace($patterns, $replacements, $string);
  17. }
  18. return $string;
  19. }
  20.  
  21. function seo_html($string) {
  22. $a = array('"', '\'');
  23. $b = array('', '');
  24. $string = str_replace($a, $b, $string);
  25. $string = preg_match("[^ĘÓĄŚŁŻŹĆŃęóąśłżźćńA-Za-z0-9]", " ", $string);
  26. $string = preg_replace("/\s+/", " ", $string);
  27. $string = preg_replace("/^\W+|\W+$/", "", $string);
  28. return $string;
  29. }
  30.  
  31. // ================================================================================
    =====================
  32. // internal function for utf8 decoding
  33. // thanks to Jamie Pratt for noticing that PHP's function is a little
  34. // screwy
  35. function my_utf8_decode($string) {
  36. return strtr($string, "?questionmark.gifquestionmark.gifquestionmark.gifĽľŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖŘŮÚŰÜÝßŕáâăäĺćçčéęëěíîďđńňóôőöřůúűüý˙", "SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy");
  37. }
  38.  
  39. // sanitize a string in prep for passing a single argument to system() (or similar)
  40. // input string, returns string stripped of special characters
  41. function sanitize_system_string($string) {
  42. $pattern = '/(;|\||`|>|<|&|^|"|' . "\n|\r|'" . '|{|}|[|]|\)|\()/i'; // no piping, passing possible environment variables ($),
  43. // seperate commands, nested execution, file redirection,
  44. // background processing, special commands (backspace, etc.), quotes
  45. // newlines, or some other special characters
  46. $string = preg_replace($pattern, '', $string);
  47. $string = '"' . preg_replace('/\$/', '\\\$', $string) . '"'; //make sure this is only interpretted as ONE argument
  48. return $string;
  49. }
  50.  
  51. // sanitize a string for SQL input (simple slash out quotes and slashes)
  52. // input string, returns string with slashed out quotes
  53. function sanitize_sql_string($string) {
  54. $pattern[0] = '/(\\\\)/';
  55. $pattern[1] = "/\"/";
  56. $pattern[2] = "/'/";
  57. $replacement[0] = '\\\\\\';
  58. $replacement[1] = '\"';
  59. $replacement[2] = "\\'";
  60. return preg_replace($pattern, $replacement, $string);
  61. }
  62.  
  63. // sanitize a string for HTML (make sure nothing gets interpretted!)
  64. function sanitize_html_string($string) {
  65. $pattern[0] = '/\&/';
  66. $pattern[1] = '/</';
  67. $pattern[2] = "/>/";
  68. $pattern[3] = '/\n/';
  69. $pattern[4] = '/"/';
  70. $pattern[5] = "/'/";
  71. $pattern[6] = "/%/";
  72. $pattern[7] = '/\(/';
  73. $pattern[8] = '/\)/';
  74. $pattern[9] = '/\+/';
  75. $pattern[10] = '/-/';
  76. $replacement[0] = '&amp;';
  77. $replacement[1] = '&lt;';
  78. $replacement[2] = '&gt;';
  79. $replacement[3] = '<br>';
  80. $replacement[4] = '&quot;';
  81. $replacement[5] = ''';
  82. $replacement[6] = '%';
  83. $replacement[7] = '(';
  84. $replacement[8] = ')';
  85. $replacement[9] = '+';
  86. $replacement[10] = '-';
  87. return preg_replace($pattern, $replacement, $string);
  88. }
  89.  
  90. // ================================================================================
    =====================
Go to the top of the page
+Quote Post

Posty w temacie
- Maker5   [PHP]Naprawa błędu w dodawaniu strony   17.07.2019, 11:42:05
- - nospor   Jedyne co ci mozemy powiedziec na podstawie takiej...   17.07.2019, 11:51:31
- - Maker5   Cytat(nospor @ 17.07.2019, 12:51:31 )...   17.07.2019, 12:04:19
- - nospor   A widzisz jakies interesujace info w logach consol...   17.07.2019, 12:05:10
- - Maker5   Cytat(nospor @ 17.07.2019, 13:05:10 )...   17.07.2019, 12:36:51
- - nospor   CytatToo few arguments to function valid_text(), 3...   17.07.2019, 13:40:12
- - Maker5   Cytat(nospor @ 17.07.2019, 14:40:12 )...   17.07.2019, 15:13:41
- - nospor   No ja tez nie wiem. Blad wyraznie mowi, ze funkcj...   17.07.2019, 15:21:56
- - Maker5   Cytat(nospor @ 17.07.2019, 16:21:56 )...   17.07.2019, 15:29:59
- - nospor   No to zmien text = valid_text($field_2, get_h...   17.07.2019, 15:30:51
- - Maker5   Cytat(nospor @ 17.07.2019, 16:30:51 )...   17.07.2019, 15:48:08
- - nospor   Komunikat jest dosc wyrazny... zmien kolejnosc o ...   17.07.2019, 15:49:57
- - Maker5   Cytat(nospor @ 17.07.2019, 16:49:57 )...   17.07.2019, 16:02:29
- - nospor   Dobrzy by zobaczyc co zawiera zmienna $patter...   17.07.2019, 16:04:06
- - Maker5   Cytat(nospor @ 17.07.2019, 17:04:06 )...   17.07.2019, 16:06:39
- - nospor   czyli nie da sie.... strzelam: Zamien return pre...   17.07.2019, 16:09:23
- - Maker5   Cytat(nospor @ 17.07.2019, 17:09:23 )...   17.07.2019, 16:38:59
- - nospor   Przed ta linia daj if ($wersja === null) { ...   17.07.2019, 16:54:02
- - Maker5   Cytat(nospor @ 17.07.2019, 17:54:02 )...   17.07.2019, 17:03:11
- - nospor   A jaka masz wersje php? Zamien $wersja = []...   17.07.2019, 17:11:40
- - Maker5   Cytat(nospor @ 17.07.2019, 18:11:40 )...   17.07.2019, 17:25:43
- - nospor   Bo operacje jakies dziwne sa robione? Patrzac jak...   17.07.2019, 18:21:11
- - Maker5   Cytat(nospor @ 17.07.2019, 19:21:11 )...   17.07.2019, 18:52:30


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 28.06.2025 - 05:09