openmgraph und hotfix in string
This commit is contained in:
parent
e44c10c5c2
commit
88f87e15b4
15
og.php
Normal file
15
og.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
function scanOG($url) {
|
||||||
|
$og = array();
|
||||||
|
$html = file_get_contents($url);
|
||||||
|
|
||||||
|
$re = '/<meta (name|property)=("|\')(.*?)("|\').*?content=("|\')(.*?)("|\')/m';
|
||||||
|
preg_match_all($re, $html, $matches, PREG_SET_ORDER, 0);
|
||||||
|
|
||||||
|
foreach($matches as $m) {
|
||||||
|
$og[$m[3]] = $m[6];
|
||||||
|
}
|
||||||
|
//print_r($og);
|
||||||
|
return $og;
|
||||||
|
}
|
||||||
|
?>
|
||||||
10
string.php
10
string.php
@ -35,11 +35,11 @@ function noScript($str) {
|
|||||||
function random($name_laenge) {
|
function random($name_laenge) {
|
||||||
$zeichen = "abcedfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZ0123456789";
|
$zeichen = "abcedfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZ0123456789";
|
||||||
$name_neu = "";
|
$name_neu = "";
|
||||||
|
|
||||||
@mt_srand ( ( double ) microtime () * 1000000 );
|
@mt_srand ( ( double ) microtime () * 1000000 );
|
||||||
for($i = 0; $i < $name_laenge; $i ++) {
|
for($i = 0; $i < $name_laenge; $i ++) {
|
||||||
$r = mt_rand ( 0, strlen ( $zeichen ) - 1 );
|
$r = mt_rand ( 0, strlen ( $zeichen ) - 1 );
|
||||||
$name_neu .= $zeichen {$r};
|
$name_neu .= $zeichen[$r];
|
||||||
}
|
}
|
||||||
return $name_neu;
|
return $name_neu;
|
||||||
}
|
}
|
||||||
@ -49,7 +49,7 @@ function startsWith($haystack, $needle) {
|
|||||||
}
|
}
|
||||||
function endsWith($haystack, $needle) {
|
function endsWith($haystack, $needle) {
|
||||||
$length = strlen ( $needle );
|
$length = strlen ( $needle );
|
||||||
|
|
||||||
return $length === 0 || (substr ( $haystack, - $length ) === $needle);
|
return $length === 0 || (substr ( $haystack, - $length ) === $needle);
|
||||||
}
|
}
|
||||||
function onlyAlpha($str, $zus = '') {
|
function onlyAlpha($str, $zus = '') {
|
||||||
@ -247,7 +247,7 @@ function onlySimpleHTML($s) {
|
|||||||
'<pre>',
|
'<pre>',
|
||||||
'<pre/>'
|
'<pre/>'
|
||||||
), $s );
|
), $s );
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-',
|
'{{|-',
|
||||||
@ -256,7 +256,7 @@ function onlySimpleHTML($s) {
|
|||||||
'',
|
'',
|
||||||
''
|
''
|
||||||
), $s );
|
), $s );
|
||||||
|
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
function linkify($input) {
|
function linkify($input) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user