-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
HungNA - Technical Manager
committed
Oct 16, 2024
1 parent
9441051
commit 1bd1426
Showing
5 changed files
with
27 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,4 +124,5 @@ composer.lock | |
|
||
tmp/* | ||
!tmp/.htaccess | ||
!tmp/.gitkeep | ||
!tmp/.gitkeep | ||
test.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,13 @@ | |
* Date: 09/08/2021 | ||
* Time: 07:33 | ||
*/ | ||
if ( ! function_exists('gravatarUrlWithUsername')) { | ||
if (!function_exists('gravatarUrlWithUsername')) { | ||
/** | ||
* Function gravatarUrlWithUsername | ||
* | ||
* @param string $username Username on Gravatar you need Get | ||
* @param int $size Sizing of Gravatar Output | ||
* @param string $cachePath /your/to/path for Save Cache | ||
* @param string $username Username on Gravatar you need Get | ||
* @param int $size Sizing of Gravatar Output | ||
* @param string $cachePath /your/to/path for Save Cache | ||
* | ||
* @return string|null | ||
* @author : 713uk13m <[email protected]> | ||
|
@@ -32,12 +32,12 @@ function gravatarUrlWithUsername($username = 'nguyenanhung', $size = 300, $cache | |
return $gravatar->showAvatar($size); | ||
} | ||
} | ||
if ( ! function_exists('gravatarUrlWithEmail')) { | ||
if (!function_exists('gravatarUrlWithEmail')) { | ||
/** | ||
* Function gravatarUrlWithEmail | ||
* | ||
* @param string $email | ||
* @param int $size | ||
* @param string $email | ||
* @param int $size | ||
* | ||
* @return string | ||
* @author : 713uk13m <[email protected]> | ||
|
@@ -46,7 +46,13 @@ function gravatarUrlWithUsername($username = 'nguyenanhung', $size = 300, $cache | |
*/ | ||
function gravatarUrlWithEmail($email = '[email protected]', $size = 300) | ||
{ | ||
$email = md5($email); | ||
return 'https://www.gravatar.com/avatar/' . $email . '?s=' . $size; | ||
// Trim leading and trailing whitespace from | ||
// an email address and force all characters | ||
// to lower case | ||
$address = strtolower(trim($email)); | ||
|
||
// Create an SHA256 hash of the final string | ||
$hash = hash('sha256', $address); | ||
return 'https://www.gravatar.com/avatar/' . $hash . '?s=' . $size; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,9 +22,9 @@ trait Helper | |
/** | ||
* Function sendRequest | ||
* | ||
* @param string $url | ||
* @param array $params | ||
* @param int $timeout | ||
* @param string $url | ||
* @param array $params | ||
* @param int $timeout | ||
* | ||
* @return bool|string | ||
* @author : 713uk13m <[email protected]> | ||
|