Changeset 3345317
- Timestamp:
- 08/15/2025 11:21:51 PM (8 months ago)
- Location:
- wp-stats-manager
- Files:
-
- 4 edited
-
tags/8.3/includes/wsm_db.php (modified) (2 diffs)
-
tags/8.3/includes/wsm_init.php (modified) (1 diff)
-
trunk/includes/wsm_db.php (modified) (2 diffs)
-
trunk/includes/wsm_init.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-stats-manager/tags/8.3/includes/wsm_db.php
r3345313 r3345317 372 372 } 373 373 } 374 function fnReturnURLElements($url)374 /* function fnReturnURLElements($url) 375 375 { 376 376 //$url=strtolower($url); … … 382 382 $hash = substr(md5($newURL), 0, 16); 383 383 return array('protocol' => $arrURL['scheme'] . '://', 'url' => $newURL, 'hash' => $hash); 384 } 384 }*/ 385 386 function fnReturnURLElements($url) 387 { 388 $url = rtrim((string) $url, "/"); 389 if ($url === '') { 390 return array('protocol' => '', 'url' => '', 'hash' => ''); 391 } 392 393 $parts = @parse_url($url); 394 if ($parts === false) { 395 396 $newURL = preg_replace('#^https?://#i', '', $url); 397 $newURL = preg_replace('#^www\.#i', '', $newURL); 398 return array('protocol' => '', 'url' => $newURL, 'hash' => substr(md5($newURL), 0, 16)); 399 } 400 401 $scheme = isset($parts['scheme']) ? $parts['scheme'] : ''; 402 $protocol = $scheme !== '' ? $scheme . '://' : ''; 403 404 405 $newURL = $url; 406 if ($protocol !== '') { 407 $newURL = preg_replace('#^' . preg_quote($protocol, '#') . '#i', '', $newURL); 408 } 409 $newURL = preg_replace('#^www\.#i', '', $newURL); 410 411 return array( 412 'protocol' => $protocol, 413 'url' => $newURL, 414 'hash' => substr(md5($newURL), 0, 16), 415 ); 416 } 417 418 419 385 420 function fnGetSearchEngineID($url) 386 421 { -
wp-stats-manager/tags/8.3/includes/wsm_init.php
r3345313 r3345317 1904 1904 1905 1905 // User lowercase string for comparison. 1906 $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); 1906 // $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); 1907 $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : ''; 1908 1907 1909 1908 1910 // A list of some common words used only for bots and crawlers. -
wp-stats-manager/trunk/includes/wsm_db.php
r3251041 r3345317 372 372 } 373 373 } 374 function fnReturnURLElements($url)374 /* function fnReturnURLElements($url) 375 375 { 376 376 //$url=strtolower($url); … … 382 382 $hash = substr(md5($newURL), 0, 16); 383 383 return array('protocol' => $arrURL['scheme'] . '://', 'url' => $newURL, 'hash' => $hash); 384 } 384 }*/ 385 386 function fnReturnURLElements($url) 387 { 388 $url = rtrim((string) $url, "/"); 389 if ($url === '') { 390 return array('protocol' => '', 'url' => '', 'hash' => ''); 391 } 392 393 $parts = @parse_url($url); 394 if ($parts === false) { 395 396 $newURL = preg_replace('#^https?://#i', '', $url); 397 $newURL = preg_replace('#^www\.#i', '', $newURL); 398 return array('protocol' => '', 'url' => $newURL, 'hash' => substr(md5($newURL), 0, 16)); 399 } 400 401 $scheme = isset($parts['scheme']) ? $parts['scheme'] : ''; 402 $protocol = $scheme !== '' ? $scheme . '://' : ''; 403 404 405 $newURL = $url; 406 if ($protocol !== '') { 407 $newURL = preg_replace('#^' . preg_quote($protocol, '#') . '#i', '', $newURL); 408 } 409 $newURL = preg_replace('#^www\.#i', '', $newURL); 410 411 return array( 412 'protocol' => $protocol, 413 'url' => $newURL, 414 'hash' => substr(md5($newURL), 0, 16), 415 ); 416 } 417 418 419 385 420 function fnGetSearchEngineID($url) 386 421 { -
wp-stats-manager/trunk/includes/wsm_init.php
r3338192 r3345317 1904 1904 1905 1905 // User lowercase string for comparison. 1906 $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); 1906 // $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); 1907 $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : ''; 1908 1907 1909 1908 1910 // A list of some common words used only for bots and crawlers.
Note: See TracChangeset
for help on using the changeset viewer.