Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
glpi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
GLPI
glpi
Commits
0a308217
Commit
0a308217
authored
Apr 01, 2019
by
Cédric Anne
Committed by
Johan Cwiklinski
Apr 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warning on missing images
parent
5042df42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
inc/document.class.php
inc/document.class.php
+3
-0
tests/functionnal/Document.php
tests/functionnal/Document.php
+2
-1
No files found.
inc/document.class.php
View file @
0a308217
...
...
@@ -1548,6 +1548,9 @@ class Document extends CommonDBTM {
* @return boolean
*/
public
static
function
isImage
(
$file
)
{
if
(
!
file_exists
(
$file
))
{
return
false
;
}
if
(
extension_loaded
(
'exif'
))
{
$etype
=
exif_imagetype
(
$file
);
return
in_array
(
$etype
,
[
IMAGETYPE_JPEG
,
IMAGETYPE_GIF
,
IMAGETYPE_PNG
,
IMAGETYPE_BMP
]);
...
...
tests/functionnal/Document.php
View file @
0a308217
...
...
@@ -220,7 +220,8 @@ class Document extends DbTestCase {
[
__DIR__
.
"/../../pics/add_dropdown.png"
,
true
],
[
__DIR__
.
"/../../pics/corners.gif"
,
true
],
[
__DIR__
.
"/../../pics/PICS-AUTHORS.txt"
,
false
],
[
__DIR__
.
"/../notanimage.jpg"
,
false
]
[
__DIR__
.
"/../notanimage.jpg"
,
false
],
[
__DIR__
.
"/../notafile.jpg"
,
false
]
];
}
...
...
Write
Preview
Markdown
is supported
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