Ticket #1484734 (closed Patches: wontfix)

Opened 11 months ago

Last modified 11 months ago

function getallheaders exists when using litespeed, but shouldn't, and returns an empty array.

Reported by: phallstrom Owned by:
Priority: 5 Milestone: 0.1-stable
Component: Core functionality Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

On a trunk checkout of a day or two ago (971) roundcube doesn't work with the litespeed webserver. The function 'getallheaders' is only supposed to be defined for apache, but it's also defined for the litespeed-php module, but returns an empty array. This breaks the ajax checks (see bug 1484508 for related info).

This patch fixes it:

Index: program/include/rcube_shared.inc
===================================================================
--- program/include/rcube_shared.inc    (revision 971)
+++ program/include/rcube_shared.inc    (working copy)
@@ -535,7 +535,7 @@
  */
 function rc_request_header($name)
 {
-  if (function_exists('getallheaders'))
+  if (function_exists('getallheaders') && php_sapi_name() != 'litespeed')
   {
     $hdrs = array_change_key_case(getallheaders(), CASE_UPPER);
     $key  = strtoupper($name);

I've also let litespeed know about this and suggested they either implement the method or remove it...

http://www.litespeedtech.com/support/forum/showthread.php?p=8487

Change History

Changed 11 months ago by phallstrom

It occurs to me that a better check would be to check *for* php_sapi_name matching 'apache'... as this must be a problem for other modules as well...

Index: program/include/rcube_shared.inc
===================================================================
--- program/include/rcube_shared.inc    (revision 971)
+++ program/include/rcube_shared.inc    (working copy)
@@ -535,7 +535,7 @@
  */
 function rc_request_header($name)
 {
-  if (function_exists('getallheaders'))
+  if (function_exists('getallheaders') && ereg('^apache', php_sapi_name()))
   {
     $hdrs = array_change_key_case(getallheaders(), CASE_UPPER);
     $key  = strtoupper($name);
Index: .htaccess
===================================================================

Changed 11 months ago by thomasb

  • severity changed from critical to normal
  • milestone set to 0.1-stable

You better report this bug to litespeed.

Changed 11 months ago by till

  • status changed from new to closed
  • resolution set to wontfix

Sorry, just had to laugh at this one, especially since they now implemented it:

It has been fixed in our latest php-litespeed SAPI 4.5 release.
Added implementation of getallheaders() and apache_request_headers()

Therefor I am closing this ticket. It also makes no sense to correct this for any other webserver since the code checks if the function exists. If it exists, it should be available.

Not a RoundCube bug'''

Note: See TracTickets for help on using tickets.