]> source.dussan.org Git - nextcloud-server.git/commitdiff
The regexp of the Freebox user agent is now more strict.
authorMartial Saunois <saunois.martial@gmail.com>
Wed, 29 Jan 2014 09:58:34 +0000 (10:58 +0100)
committerMartial Saunois <saunois.martial@gmail.com>
Wed, 29 Jan 2014 09:58:34 +0000 (10:58 +0100)
A new unit test has been added in consequence.

lib/private/request.php
tests/lib/request.php

index 855148ac25a217e3fa41c3efab6ff3827dccb5e0..2c5b907846ef51911f53301cf490b4b3bc6c602b 100755 (executable)
@@ -11,7 +11,7 @@ class OC_Request {
        const USER_AGENT_IE = '/MSIE/';
        // Android Chrome user agent: https://developers.google.com/chrome/mobile/docs/user-agent
        const USER_AGENT_ANDROID_MOBILE_CHROME = '#Android.*Chrome/[.0-9]*#';
-       const USER_AGENT_FREEBOX = '#Mozilla/5\.0$#';
+       const USER_AGENT_FREEBOX = '#^Mozilla/5\.0$#';
 
        /**
         * @brief Check overwrite condition
index 3cb58674d3e69310a86081c5fb4a4f3bb78a2770..1d77acc70ae8ca90a99f4dd9ab376864ce4b82bd 100644 (file)
@@ -128,6 +128,11 @@ class Test_Request extends PHPUnit_Framework_TestCase {
                                OC_Request::USER_AGENT_FREEBOX,
                                true
                        ),
+                       array(
+                               'Fake Mozilla/5.0',
+                               OC_Request::USER_AGENT_FREEBOX,
+                               false
+                       ),
                );
        }
 }