Added some more timestamp measuring

This commit is contained in:
Michael Vogel 2015-03-07 23:14:26 +01:00
parent 1cf3cb493f
commit dbe8275ae5
4 changed files with 211 additions and 188 deletions

View file

@ -681,6 +681,8 @@ function bb_RemovePictureLinks($match) {
if(is_null($text)){
$a = get_app();
$stamp1 = microtime(true);
$ch = @curl_init($match[1]);
@curl_setopt($ch, CURLOPT_NOBODY, true);
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@ -688,6 +690,8 @@ function bb_RemovePictureLinks($match) {
@curl_exec($ch);
$curl_info = @curl_getinfo($ch);
$a->save_timestamp($stamp1, "network");
if (substr($curl_info["content_type"], 0, 6) == "image/")
$text = "[url=".$match[1]."]".$match[1]."[/url]";
else {
@ -731,6 +735,8 @@ function bb_CleanPictureLinksSub($match) {
if(is_null($text)){
$a = get_app();
$stamp1 = microtime(true);
$ch = @curl_init($match[1]);
@curl_setopt($ch, CURLOPT_NOBODY, true);
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@ -738,6 +744,8 @@ function bb_CleanPictureLinksSub($match) {
@curl_exec($ch);
$curl_info = @curl_getinfo($ch);
$a->save_timestamp($stamp1, "network");
// if its a link to a picture then embed this picture
if (substr($curl_info["content_type"], 0, 6) == "image/")
$text = "[img]".$match[1]."[/img]";