mirror of
https://github.com/friendica/friendica
synced 2025-04-24 08:30:11 +00:00
Added some more timestamp measuring
This commit is contained in:
parent
1cf3cb493f
commit
dbe8275ae5
4 changed files with 211 additions and 188 deletions
|
@ -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]";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue