Closed GoogleCodeExporter closed 8 years ago
[deleted comment]
[deleted comment]
The above fix, by itself, does not address this issue!!!
Using "INI_SCANNER_RAW" converts false to a string, rather than a boolean.
The work-around is change ~line 354 from:
$browser[$key] = $value;
to:
switch($value){
case 'true':
$browser[$key] = true;
break;
case 'false':
$browser[$key] = false;
break;
default:
$browser[$key] = $value;
}
Original comment by eric.caron
on 2 Sep 2009 at 3:17
Well, the fix did address MY issue! :-) Which was getting anything out at all.
My
application does not use the Boolean capability info yet, so that shortcoming
had
gone under my radar so far. (If this was working before, then previous PHP
versions
must have parsed values but not section names.)
Thanks for the heads up, Eric.
Original comment by sebastia...@gmail.com
on 2 Sep 2009 at 3:32
I've submitted this as a bug to PHP, please give it some attention & love at
http://bugs.php.net/bug.php?id=49443
Original comment by eric.caron
on 2 Sep 2009 at 3:53
Done.
Good on you, Eric
Original comment by sebastia...@gmail.com
on 2 Sep 2009 at 6:24
Update: The problem lies actually in the semicolon, which in 5.3 is interpreted
as a
comment delimiter even inside the header, disabling the closing square bracket
].
I've submitted this as a new bug to PHP, please give your support at
http://bugs.php.net/bug.php?id=49461
Original comment by sebastia...@gmail.com
on 4 Sep 2009 at 6:13
It better to use the already provided constant PHP_VERSION instead of
phpversion()
if (version_compare(PHP_VERSION, '5.3.0')=='ge') {
$browsers = parse_ini_file($ini_path, true, INI_SCANNER_RAW);
}else{
$browsers = parse_ini_file($ini_path, true);
}
Original comment by oc3...@gmail.com
on 8 Sep 2009 at 7:41
Not a bad idea, though comparison with the string 'ge' won't work;
version_compare
returns -1, 0 or 1 by default, or true/false if used with the opt. operator.
So you either have to say
if (version_compare(PHP_VERSION, '5.3.0')>=0) {...}
or as I did above
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {...}
I wish we soon can change the operator to '=='...
Original comment by sebastia...@gmail.com
on 8 Sep 2009 at 7:54
yes sorry,i gave untested code from what i remembered, after taking a look at
the
manual it turns out you're right. The `ge`(the same as >=) used by me at the
comparison
is instead to be used as the third optional operator.
== operator makes more sense but the third optional param is ok also :)
Original comment by oc3...@gmail.com
on 9 Sep 2009 at 5:12
Yes, it worked! Thank you!
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
$browsers = parse_ini_file($ini_path, true, INI_SCANNER_RAW);
}else{
$browsers = parse_ini_file($ini_path, true);
}
Original comment by cem...@gmail.com
on 30 Sep 2009 at 7:17
[deleted comment]
I think this fix should go into the class itself instead of being only available
here. I just lost several hours trying to figure out what was wrong with the
Browscap
class since it always returned an empty array. Turns out I have PHP 5.3.1 which
is
affected by this problem. It is likely that more people will stumble upon this
issue
since if affects all 5.3 versions so far and there is no exception or error
returned,
so it's hard to figure out what the problem is. I believe this is a serious bug.
Apart from that, excelent class!!
Original comment by dev...@iol.pt
on 19 Apr 2010 at 3:28
@13, agreed. Is anyone maintaining the code here?
Original comment by triplepoint
on 27 Apr 2010 at 7:30
@13, agreed. the fix should be included in release. after ubuntu upgrade, i
have also
spent few hours on figuring out what's the problem.
Original comment by schkov...@gmail.com
on 4 May 2010 at 6:46
Be sure to empty your cache after applying the patch suggested by oc3ans.
Original comment by tedmaste...@gmail.com
on 6 Jul 2010 at 11:51
Finally, after quite 1 year, the fix is committed in the github repository.
Sorry to all who waited for this to happen soon.
Original comment by st.jonat...@gmail.com
on 11 Jul 2010 at 1:53
[deleted comment]
Hi guys,
I've applied every upgrade that's been described in this doc and I still get an
empty array. Help?
Original comment by popamo...@gmail.com
on 23 Sep 2010 at 9:24
Attachments:
Hi guis,
I am repair (I see old bug) in method updateCache() in different php version
(5.2.XX / 5.3.XX) in function parse_ini_file, see attach file
Original comment by geniv.ra...@gmail.com
on 13 Jan 2011 at 10:43
Attachments:
http://code.google.com/p/phpbrowscap/ isn't the announcement big enough?
Let me know on github if it is still not working for you
Original comment by st.jonat...@gmail.com
on 13 Jan 2011 at 10:46
I just want to make it clear that after upgrading my Browscap.php to the latest
in the github repo, I was still getting an empty array. It took me a few but I
ended up deleting both the cache.php and browscap.php file and letting it
generate new ones. That solved my problem, for whatever reason all the arrays
in cache.php were empty.
I am only posting this here also since some people may check this, just wanted
to stop further comments since it wasn't clear, comment #16 suggests deleting
the cache but didn't really explain that it would solve the problems of empty
arrays. Some people need extra prodding :P
Original comment by trippin7464
on 20 Mar 2011 at 3:18
Original issue reported on code.google.com by
sebastia...@gmail.com
on 2 Sep 2009 at 7:39