mirror of
https://github.com/Rouji/single_php_filehost.git
synced 2025-04-10 19:08:45 +00:00
trim long extensions
This commit is contained in:
parent
110381682a
commit
ccb5da9d6e
@ -140,6 +140,7 @@ function storeFile($name, $tmpFile, $formatted = false)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//extract extension from a path (does not include the dot)
|
||||||
function getExtension($path)
|
function getExtension($path)
|
||||||
{
|
{
|
||||||
$ext = pathinfo($path, PATHINFO_EXTENSION);
|
$ext = pathinfo($path, PATHINFO_EXTENSION);
|
||||||
@ -149,6 +150,8 @@ function getExtension($path)
|
|||||||
{
|
{
|
||||||
$ext = $ext2.'.'.$ext;
|
$ext = $ext2.'.'.$ext;
|
||||||
}
|
}
|
||||||
|
//trim extension to max. 7 chars
|
||||||
|
$ext = substr($ext,0,7);
|
||||||
return $ext;
|
return $ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user