function geturiparam($pathdelimiter, $addhttp) { $uri = @$_REQUEST['uri']; // use explicitly specified uri parameter if any // if no explict url is found, get it from the path if ($uri == '') { if ($pathdelimiter == '') { $pathdelimiter = '.com/'; } $uri = explode($pathdelimiter, $_SERVER['REQUEST_URI'], 2); $uri = $uri[1]; } $uri = webaddresstouri(urldecode($uri), $addhttp); // if no explicit nor path uri, look for use referrer request if ($uri == 'referrer' || $uri == 'referer' || $uri == 'http://referrer' || $uri == 'http://referer') { $uri = getenv("HTTP_REFERER"); } return $uri; }
function get_in_reply_to_urls($s) { $s = explode('in-reply-to: ', $s); $irtn = count($s); if ($irtn < 2) { return array(); } $r = array(); $re = auto_link_re(); for ($i = 1; $i < $irtn; $i++) { $ms = preg_matches($re, $s[$i]); $msn = count($ms); if ($ms) { $sp = preg_split($re, $s[$i]); $j = 0; $afterlink = ''; while ($j < $msn && $afterlink == '' && ($sp[$j] == '' || ctype_space($sp[$j]))) { $m = $ms[$j]; if ($m[0] != '@') { $ac = substr($m, -1, 1); while (contains('.!?,;"\')]}', $ac) && ($ac != ')' || !contains($m, '('))) { $afterlink = strcat($ac, $afterlink); $m = substr($m, 0, -1); $ac = substr($m, -1, 1); } if (substr($m, 0, 6) === 'irc://') { } else { $r[count($r)] = webaddresstouri($m, true); } } $j++; } } } return $r; }