View Issue Details

IDProjectCategoryView StatusLast Update
0010886mantisbttoolspublic2009-10-07 14:19
Reporterha17 Assigned Todhx  
PrioritylowSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Product Version1.1.8 
Target Version1.2.0rc2Fixed in Version1.2.0rc2 
Summary0010886: Use php_sapi_name to determine if script is running in CLI environment
Description

on line 36 it says:

"# @@@ This is a hack to detect php-cgi, there must be a better way."

if ( php_sapi_name () == 'cli' )

is a better way.

Additional Information

http://us.php.net/manual/en/function.php-sapi-name.php

TagsNo tags attached.

Activities

ha17

ha17

2009-08-28 17:57

reporter   ~0022825

Also on line 32/33 of core/checkin.php

dhx

dhx

2009-08-31 07:06

reporter   ~0022832

Thanks for the heads up. I've fixed this in the 1.3.x and 1.2.x branches.

Related Changesets

MantisBT: master-1.2.x c8d2b5f9

2009-08-31 07:03

dhx


Details Diff
Fix 0010886: Use more robust method of determining php-cgi

Use the php_sapi_name function to check if the script is being executed
from the command line. This is more robust than checking if the server
port variable is defined by PHP.

Thanks to ha17 for this suggestion.
Affected Issues
0010886
mod - scripts/send_emails.php Diff File
mod - scripts/checkin.php Diff File

MantisBT: master 8a1f1d0a

2009-08-31 07:03

dhx


Details Diff
Fix 0010886: Use more robust method of determining php-cgi

Use the php_sapi_name function to check if the script is being executed
from the command line. This is more robust than checking if the server
port variable is defined by PHP.

Thanks to ha17 for this suggestion.
Affected Issues
0010886
mod - scripts/send_emails.php Diff File
mod - scripts/checkin.php Diff File