mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-19 23:43:42 +00:00
privacy_image_cache: If the cached file would be too long then don't cache it.
This commit is contained in:
parent
168f675f27
commit
e58decc5f2
1 changed files with 11 additions and 3 deletions
|
@ -227,8 +227,16 @@ function privacy_image_cache_cachename($url, $writemode = false) {
|
||||||
*/
|
*/
|
||||||
function privacy_image_cache_is_local_image($url) {
|
function privacy_image_cache_is_local_image($url) {
|
||||||
if ($url[0] == '/') return true;
|
if ($url[0] == '/') return true;
|
||||||
|
|
||||||
if (strtolower(substr($url, 0, 5)) == "data:") return true;
|
if (strtolower(substr($url, 0, 5)) == "data:") return true;
|
||||||
|
|
||||||
|
// Check if the cached path would be longer than 255 characters - apache doesn't like it
|
||||||
|
if (is_dir($_SERVER["DOCUMENT_ROOT"]."/privacy_image_cache")) {
|
||||||
|
$cachedurl = get_app()->get_baseurl()."/privacy_image_cache/". privacy_image_cache_cachename($url);
|
||||||
|
if (strlen($url) > 255)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// links normalised - bug #431
|
// links normalised - bug #431
|
||||||
$baseurl = normalise_link(get_app()->get_baseurl());
|
$baseurl = normalise_link(get_app()->get_baseurl());
|
||||||
$url = normalise_link($url);
|
$url = normalise_link($url);
|
||||||
|
|
Loading…
Reference in a new issue