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
/**
* Method to sanitize incoming html.
* Take from cakephp (http://cakephp.org)
* Licensed under the MIT License
*
* @param unknown_type $string
* @param unknown_type $remove
* @return unknown
*/
function clean_html($string, $remove = false) {
if ($remove) {
} else {
$patterns = array("/\&/", "/%/", "/</", "/>/", '/"/', "/'/", "/\(/", "/\)/", "/\+/", "/-/"); $replacements = array("&", "%", "<", ">", """, "'", "(", ")", "+", "-"); }
return $string;
}
function seo_html($string) {
$string = preg_match("[^ĘÓĄŚŁŻŹĆŃęóąśłżźćńA-Za-z0-9]", " ", $string); return $string;
}
// ================================================================================
=====================
// internal function for utf8 decoding
// thanks to Jamie Pratt for noticing that PHP's function is a little
// screwy
function my_utf8_decode($string) {
return strtr($string, "?

ĽľŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖŘŮÚŰÜÝßŕáâăäĺćçčéęëěíîďđńňóôőöřůúűüý˙", "SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy"); }
// sanitize a string in prep for passing a single argument to system() (or similar)
// input string, returns string stripped of special characters
function sanitize_system_string($string) {
$pattern = '/(;|\||`|>|<|&|^|"|' . "\n|\r|'" . '|{|}|[|]|\)|\()/i'; // no piping, passing possible environment variables ($),
// seperate commands, nested execution, file redirection,
// background processing, special commands (backspace, etc.), quotes
// newlines, or some other special characters
$string = '"' . preg_replace('/\$/', '\\\$', $string) . '"'; //make sure this is only interpretted as ONE argument return $string;
}
// sanitize a string for SQL input (simple slash out quotes and slashes)
// input string, returns string with slashed out quotes
function sanitize_sql_string($string) {
$pattern[0] = '/(\\\\)/';
$pattern[1] = "/\"/";
$pattern[2] = "/'/";
$replacement[0] = '\\\\\\';
$replacement[1] = '\"';
$replacement[2] = "\\'";
}
// sanitize a string for HTML (make sure nothing gets interpretted!)
function sanitize_html_string($string) {
$pattern[0] = '/\&/';
$pattern[1] = '/</';
$pattern[2] = "/>/";
$pattern[3] = '/\n/';
$pattern[4] = '/"/';
$pattern[5] = "/'/";
$pattern[6] = "/%/";
$pattern[7] = '/\(/';
$pattern[8] = '/\)/';
$pattern[9] = '/\+/';
$pattern[10] = '/-/';
$replacement[0] = '&';
$replacement[1] = '<';
$replacement[2] = '>';
$replacement[3] = '<br>';
$replacement[4] = '"';
$replacement[5] = ''';
$replacement[6] = '%';
$replacement[7] = '(';
$replacement[8] = ')';
$replacement[9] = '+';
$replacement[10] = '-';
return preg_replace($pattern, $replacement, $string);
}
// ================================================================================
=====================