This question is locked. New answers and comments are not allowed.
Hi,
I'm experimenting with the IimageBrowser (php) and ran into an issue.
When creating a new instance of the ImageBrowser class, I received an error:
That line contains the following function (the second line is the culprit here):
Trying to access an array index directly on the functioncall does not seem to do well with my PHP version:
An easy fix is to change the function to the following:
Hope that helps someone... :)
I'm experimenting with the IimageBrowser (php) and ran into an issue.
When creating a new instance of the ImageBrowser class, I received an error:
Parse error: syntax error, unexpected '[' in /var/www/test/Kendo/ImageBrowser.php on line 43
function
getImageType(
$filename
) {
$type
=
getimagesize
(
$filename
)[2];
if
(
$type
== IMAGETYPE_JPEG) {
$type
=
'jpeg'
;
}
elseif
(
$type
== IMAGETYPE_GIF) {
$type
=
'gif'
;
}
elseif
(
$type
== IMAGETYPE_PNG) {
$type
=
'png'
;
}
return
$type
;
}
PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli) (built: Mar 11 2013 14:31:48)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
function
getImageType(
$filename
) {
$type
=
getimagesize
(
$filename
);
if
(
$type
[2] == IMAGETYPE_JPEG) {
$type
=
'jpeg'
;
}
elseif
(
$type
[2] == IMAGETYPE_GIF) {
$type
=
'gif'
;
}
elseif
(
$type
[2] == IMAGETYPE_PNG) {
$type
=
'png'
;
}
return
$type
;
}