statistics.php is not platform directory separator aware

Created on 26 August 2014, about 10 years ago
Updated 30 March 2024, 5 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

10.3 ✨

Component
StatisticsΒ  β†’

Last updated 21 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