PHP-Web-Stat Support Forum
https://www.php-web-statistik.de/cgi-bin/yabb/YaBB.pl
Board (English) >> English board >> [resolved] https bug
https://www.php-web-statistik.de/cgi-bin/yabb/YaBB.pl?num=1513245527

Beitrag begonnen von Sandro kensan am 14.12.17 um 10:58:47

Titel: [resolved] https bug
Beitrag von Sandro kensan am 14.12.17 um 10:58:47
track.php does not deal correctly https in statistics. sitename detection and referer detection are broken when the web page are:

https://www.kensan.it/articoli/Telnet.php

see this two PHPwebstat stats picture whit the bug and with the bug correct:



where SITE is www.kensan.it/articoli/Telnet.php and REFERER is https://www.kensan.it/articoli/Telnet.php.



where SITE is articoli/Telnet.php and REFERER is the same and is in black color.

The https bug is in the track.php file and in sitename detection and referer detection section:


Code (php):
####################################################################
### sitename detection ###

$temp_site_name   = substr ( strstr ( substr ( $js_url , 8 ) , "/" ) , 1 );



Code (php):
####################################################################
### referer detection ###

substr ( $js_referer , 0 , strpos ( $js_referer."/" , "/" , 8 ) )

substr ( strstr ( substr ( $js_referer , 8 ) , "/" ) , 1 )


The bug is that "http://" has 7 chars but "https://" has 8 chars, in the original track.php the numbers are 7, in the above track.php the numbers are 8 and are correct fot https sites. For http sites the number correct is 7.

So for correct the bug it neded to change track.php with the code:


Code (php):
  //------------------------------------------------------------------
  // SSL Fix by www.kensan.it Sandro kensan
  if ( $_SERVER [ "HTTPS" ] == "on" ) {
    $len_http = strlen("https://");
  }else{
    $len_http = strlen("http://");
  }
  //------------------------------------------------------------------
####################################################################
### sitename detection ###

$temp_site_name   = substr ( strstr ( substr ( $js_url , $len_http ) , "/" ) , 1 );

####################################################################
### referer detection ###

substr ( $js_referer , 0 , strpos ( $js_referer."/" , "/" , $len_http ) )

substr ( strstr ( substr ( $js_referer , $len_http ) , "/" ) , 1 )

Titel: Re: [resolved] https bug
Beitrag von deksar am 17.10.20 um 10:30:39
Is this fixed with the latest one already, or we should do that manual edit?
Thanks.

Titel: Re: [resolved] https bug
Beitrag von Holger am 24.10.20 um 07:18:00
Your version is already over 2 years old. It is implemented differently in the latest version.

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