New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it safe to update the uaparser? #298

Open
zecman opened this Issue Jan 11, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@zecman

zecman commented Jan 11, 2018

Hi all

Has anyone tested to update the uaparser module?
We have a lot of new browsers out there. Does it break something when I just exchange the uaparser folder/files?

Cheers,
Zec

@l2dy

This comment has been minimized.

Show comment
Hide comment
@l2dy

l2dy Jan 16, 2018

Contributor

I tried updating regexes.json and regexes.yaml with uaparser-cli.php (with the patch below), it worked for me.

--- a/includes/ua-parser-2.1.1/uaparser-cli.php
+++ b/includes/ua-parser-2.1.1/uaparser-cli.php
@@ -115,7 +115,7 @@ if (php_sapi_name() == 'cli') {
         }

         // get the file
-        get("https://raw.github.com/tobie/ua-parser/master/regexes.yaml",$silent,$nobackup,$basePath);
+        get("https://github.com/ua-parser/uap-core/raw/master/regexes.yaml",$silent,$nobackup,$basePath);

     } else if (isset($args["c"])) {

@@ -137,7 +137,7 @@ if (php_sapi_name() == 'cli') {

 		/* Grabs regexes.yaml from the repo and saves it */

-		if ($data = @file_get_contents("https://raw.github.com/tobie/ua-parser/master/regexes.yaml")) {
+		if ($data = @file_get_contents("https://github.com/ua-parser/uap-core/raw/master/regexes.yaml")) {
 	        file_put_contents($basePath."resources/regexes.yaml", $data);
 	        print("saved YAML file from the repo...\n");
 	    } else {
Contributor

l2dy commented Jan 16, 2018

I tried updating regexes.json and regexes.yaml with uaparser-cli.php (with the patch below), it worked for me.

--- a/includes/ua-parser-2.1.1/uaparser-cli.php
+++ b/includes/ua-parser-2.1.1/uaparser-cli.php
@@ -115,7 +115,7 @@ if (php_sapi_name() == 'cli') {
         }

         // get the file
-        get("https://raw.github.com/tobie/ua-parser/master/regexes.yaml",$silent,$nobackup,$basePath);
+        get("https://github.com/ua-parser/uap-core/raw/master/regexes.yaml",$silent,$nobackup,$basePath);

     } else if (isset($args["c"])) {

@@ -137,7 +137,7 @@ if (php_sapi_name() == 'cli') {

 		/* Grabs regexes.yaml from the repo and saves it */

-		if ($data = @file_get_contents("https://raw.github.com/tobie/ua-parser/master/regexes.yaml")) {
+		if ($data = @file_get_contents("https://github.com/ua-parser/uap-core/raw/master/regexes.yaml")) {
 	        file_put_contents($basePath."resources/regexes.yaml", $data);
 	        print("saved YAML file from the repo...\n");
 	    } else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment