user2723490
user2723490

Reputation: 2100

Browser identification (get_browser) for Firefox v.25

Are there any issues with the get_browser identification of Firefox v.25? This is a simple code:

echo $_SERVER['HTTP_USER_AGENT'] . "<br>";
$browser = get_browser(null, true);
print_r($browser);

it returns correct info for all browsers except Firefox. For Firefox I am getting the following output:

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
Array (
    [browser_name_regex] => §^.*$§
    [browser_name_pattern] => *
    [comment] => Default Browser
    [browser] => Default Browser
    [version] => 0.0
    [majorver] => 0
    [minorver] => 0
    [platform] => unknown
    [platform_version] => unknown
    [alpha] => 
    [beta] => 
    [win16] => 
    [win32] => 
    [win64] => 
    [frames] => 
    [iframes] => 
    [tables] => 
    [cookies] => 
    [backgroundsounds] => 
    [javascript] => 
    [vbscript] => 
    [javaapplets] => 
    [activexcontrols] => 
    [ismobiledevice] => 
    [issyndicationreader] => 
    [crawler] => 
    [cssversion] => 0 
    [aolversion] => 0 
)

Am I missing something here? I have the latest browscap.ini from Jul 2013.

Thanks

UPDATE. I had to update the browscap.ini manually, because it missed the latest Firefox 25 definitions.

Upvotes: 1

Views: 698

Answers (1)

Abdelrahman Ahmed
Abdelrahman Ahmed

Reputation: 101

This answer was translated on Google translate

I am having the same problem, but I discovered that there is a new site to support the function get_browser(); To avoid the problem, go to the new site and download the latest version of the file browscap.ini From here http://browscap.org/ And replace the old file with the new file And restart the server on the Linux operating system

sudo service apache2 restart

Or if you are using another system and software used to run a local server search for a tool that re-configuration of the server

It is a beautiful service has been activated on the new site are: You can test if the browser is present in the list of supported browsers by Bringing data browser, which by browsing the site via the static variable

$_SERVER ['HTTP_USER_AGENT'];

For example, Firefox browser:

Mozilla/5.0 (X11; Ubuntu; Linux i686; rv: 25.0) Gecko/20100101 Firefox/25.0

This data has been retrieved by the static variable $_SERVER['HTTP_USER_AGENT'];

And then be searched for in the file browser browscap.ini

To experience the service Go to new site and Click On: UA Lookup

/* The Orginal Answer by Arabic */

كُنت اواجة نفس المُشكلة لكن اكتشفت ان هناك موقع جديد لدعم دالة get_browser(); لتجنب المشكله اذهب الى الموقع الجديد وقم بتحميل اخر اصدار لملف browscap.ini من هنا http://browscap.org/ واستبدل الملف القديم بالملف الجديد و قم باعادة تشغيل الخادم على نظام تشغيل Linux

sudo service apache2 restart

او اذا كنت تستخدم نظام آخر وتستخدم برنامج لتشغيل خادم محلى قم بالبحث عن اداة اعادة التهيئة للخادم

ومن الخدمات الجميله التى تم تفعيلها على الموقع الجديد هى: انك يمكنك اختبار إذا كان المتصفح موجود فى قائمة المتصفحات المدعومه عن طريق جلب بيانات المتصفح الذى تتصفح به الموقع عن طريق المتغير الثابت

$_SERVER['HTTP_USER_AGENT'];

فمثلاً متصفح فيرفوكس:

Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:25.0) Gecko/20100101 Firefox/25.0

تم جلب هذه البيانات عن طريق المتغير الثابت $_SERVER['HTTP_USER_AGENT'];

ويتم البحث بعد ذلك عن متصفحك فى ملف browscap.ini

لتجربة الخدمه اذهب الى الموقع الجديد واضغط على: UA Lookup

Upvotes: 1

Related Questions