') )
return esc_html($matches[0]);
return $matches[0];
}
function wp_pre_kses_less_than( $text ) {
return preg_replace_callback('%<[^>]*?((?=<)|>|$)%', 'wp_pre_kses_less_than_callback', $text);
}
function wp_strip_all_tags($string, $remove_breaks = false) {
$string = preg_replace( '@<(script|style)[^>]*?>.*?\\1>@si', '', $string );
$string = strip_tags($string);
if ( $remove_breaks )
$string = preg_replace('/[\r\n\t ]+/', ' ', $string);
return trim( $string );
}
function _sanitize_text_fields( $str, $keep_newlines = false ) {
// leads to error on server - why?
// $filtered = wp_check_invalid_utf8( $str );
$filtered = $str;
if ( strpos($filtered, '<') !== false ) {
$filtered = wp_pre_kses_less_than( $filtered );
// This will strip extra whitespace for us.
$filtered = wp_strip_all_tags( $filtered, false );
// Use html entities in a special case to make sure no later
// newline stripping stage could lead to a functional tag
$filtered = str_replace("<\n", "<\n", $filtered);
}
if ( ! $keep_newlines ) {
$filtered = preg_replace( '/[\r\n\t ]+/', ' ', $filtered );
}
$filtered = trim( $filtered );
$found = false;
while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) {
$filtered = str_replace($match[0], '', $filtered);
$found = true;
}
if ( $found ) {
// Strip out the whitespace that may now exist after removing the octets.
$filtered = trim( preg_replace('/ +/', ' ', $filtered) );
}
return $filtered;
}
// own code :-)
function obfuscateSPAMKey($key) {
$key = md5($key);
$key = preg_replace("/[0123456789]/", "", $key);
return $key;
}
function nojunk_get_values() {
$num1 = rand(10, 49);
$num2 = rand(10, 49);
$numbers = array($num1, $num2);
sort($numbers);
$operand = array("plus", "minus");
shuffle($operand);
if ($operand[0] == "plus") {
$nojunk = $numbers[1] + $numbers[0];
}
else {
$nojunk = $numbers[1] - $numbers[0];
}
$nojunk_key_1 = obfuscateSPAMKey($nojunk);
$nojunk_key_2 = time();
$nojunk_question = "$numbers[1] $operand[0] $numbers[0] ergibt";
return array($nojunk_question, $nojunk_key_1, $nojunk_key_2);
}
function mailFile($email, $subject, $message, $filename, $filedata) {
$file_data = chunk_split(base64_encode($filedata));
$mail_header = "From: <$email>";
$random_time = md5(time());
$mime_boundary = "==BlogThulOrg- $random_time";
$mail_header .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$mail_message = $message;
$mail_message .= "\nAnhang '$filename'\n";
$mail_message = "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type: text/plain; charset=\"utf-8\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" . $mail_message . "\n\n";
$mail_message .= "--{$mime_boundary}\n" .
"Content-Type: application/octet-stream;\n" .
" name=\"{$filename}\"\n" .
"Content-Disposition: attachment;\n" .
" filename=\"{$filename}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$file_data . "\n\n--{$mime_boundary}--\n";
mail($email, $subject, $mail_message, $mail_header);
}
?>
Suchergebnisse für \"$term\"\n";
echo "
\n";
if (strlen($term) > $termMinLength) {
$pattern = preg_quote($term, '/');
$pattern = "/($pattern)/mi";
$files = getFiles("$basepath/musik");
$files = array_merge($files, getFiles("$basepath/misc"));
$files = array_merge($files, getFiles("$basepath/technik"));
$count = 0;
$results = array();
foreach ($files as $file) {
$post = file_get_contents($file);
// we're only interested in real articles -> single.html
if (!preg_match("/post-separator/", $post)) {
$start = strpos($post, '