PHP-Web-Stat Support Forum
https://www.php-web-statistik.de/cgi-bin/yabb/YaBB.pl
Board (English) >> English board >> preg-match: Unknown modifier
https://www.php-web-statistik.de/cgi-bin/yabb/YaBB.pl?num=1455021092

Beitrag begonnen von Piet am 09.02.16 um 13:31:32

Titel: preg-match: Unknown modifier
Beitrag von Piet am 09.02.16 um 13:31:32
Hi, I noticed in my error log that the function operating_system_detection() in the func_operating_system.php file produces the following error:


Code (][09-Feb-2016 09:00:38 UTC):
PHP Warning:  preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Unknown modifier '.' in /home/mywebsite/public_html/web/func/func_operating_system.php on line 142


My error log is filled up with the above error message.


Titel: Re: preg-match: Unknown modifier
Beitrag von Reimar am 09.02.16 um 14:16:53
This is not an error, just a warning.
The desired function just gets to less information to work conform.
We will have to put extra code into this function to prevent this behaviour, this will be done with the next update.

Titel: Re: preg-match: Unknown modifier
Beitrag von Piet am 09.02.16 um 15:36:25
Thanks very much for your quick response. Is there an easy way to fix this in the mean time?

Titel: Re: preg-match: Unknown modifier
Beitrag von Reimar am 09.02.16 um 15:42:47
Question back: is the module operating system in your stat filled with valid values?

Titel: Re: preg-match: Unknown modifier
Beitrag von Piet am 10.02.16 um 07:22:36
Yes, it looks like they are all valid values.

Titel: Re: preg-match: Unknown modifier
Beitrag von Reimar am 10.02.16 um 14:10:54
ok thx. Then we have just to exclude this misuse of the operating system detection function.

Titel: Re: preg-match: Unknown modifier
Beitrag von Piet am 11.08.16 um 12:05:08
Hi, has this issue been resolved yet?

Titel: Re: preg-match: Unknown modifier
Beitrag von Piet am 21.01.17 um 16:13:07
Any news regarding this issue?

Titel: Re: preg-match: Unknown modifier
Beitrag von Reimar am 21.01.17 um 20:33:44
Soory no, there has not been any change, we did not get this warning.
Is it still like this? Still the same PHP version on your server?

Titel: Re: preg-match: Unknown modifier
Beitrag von Piet am 24.01.17 um 09:56:12
I did some testing, and it seems that the php warning is only generated when the $_SERVER [ "HTTP_USER_AGENT" ] variable returns an empty string.

For example, when I updated the following line:


Code (php):
$operating_system = strip_tags ( operating_system_detection ( $_SERVER [ "HTTP_USER_AGENT" ] ) ); // get operating system

to:


Code (php):
$operating_system = strip_tags ( operating_system_detection ( '' ) ); // get operating system


I got the following warning again in the error log:


Code (]PHP Warning:  preg_match() [<a href='function.preg-match'>function.preg-match</a>):
: Unknown modifier ']' in /home/my_website/public_html/web/func/func_operating_system.php on line 143


PHP-Web-Stat Support Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2012. Alle Rechte vorbehalten.