statistics.php is not platform directory separator aware

Created on 26 August 2014, over 10 years ago
Updated 30 March 2024, 9 months ago

I have encountered a new issue in statistics.php file.

My statistics counters do not increment. I am running on IIS and the define at the top

define('DRUPAL_ROOT', substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], '/modules/statistics/statistics.php')));

is not platform directory separator aware.

It should be something like:

PHP_OS == "Windows" || PHP_OS == "WINNT" ?
  define('DRUPAL_ROOT', substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], '\\modules\\statistics\\statistics.php'))) :
  define('DRUPAL_ROOT', substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], '/modules/statistics/statistics.php')))
πŸ› Bug report
Status

Needs work

Version

1.0

Component
StatisticsΒ  β†’

Last updated 4 days ago

No maintainer
Created by

πŸ‡ΏπŸ‡¦South Africa WillowDigit

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024