Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
2ae95164
Commit
2ae95164
authored
Aug 20, 2009
by
Francois Marier
Browse files
Use the Gravatar redirections to remove the server-side calls
Signed-off-by:
Francois Marier
<
francois@catalyst.net.nz
>
parent
4b27f60f
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/thumb.php
View file @
2ae95164
...
...
@@ -184,28 +184,8 @@ function gravatar_icon($email, $size=null) {
}
$url
=
"http://www.gravatar.com/avatar/
{
$md5sum
}
.jpg?r=g&s=
$s
"
;
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_URL
,
"
$url
&d=404"
);
curl_setopt
(
$ch
,
CURLOPT_REFERER
,
''
);
// for privacy
curl_setopt
(
$ch
,
CURLOPT_USERAGENT
,
'Mahara '
.
get_config
(
'release'
));
// Only return the status code
curl_setopt
(
$ch
,
CURLOPT_FAILONERROR
,
true
);
curl_setopt
(
$ch
,
CURLOPT_HEADER
,
false
);
curl_setopt
(
$ch
,
CURLOPT_NOBODY
,
true
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
true
);
// Set some aggressive timeouts
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
5
);
curl_setopt
(
$ch
,
CURLOPT_LOW_SPEED_TIME
,
10
);
if
(
false
===
curl_exec
(
$ch
))
{
return
false
;
}
else
{
return
$url
;
}
$notfound
=
get_config
(
'wwwroot'
)
.
'/thumb.php?type=profileiconbyid'
;
return
"
$url
&d="
.
urlencode
(
$notfound
);
}
?>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment