WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 3 months ago

#9763 new enhancement

Please include IdeaWebServer in $is_apache (in wp-includes/vars.php)

Reported by: burghardt Owned by:
Milestone: Future Release Priority: low
Severity: normal Version: 2.7.1
Component: Bootstrap/Load Keywords: needs-patch
Focuses: Cc:

Description

IdeaWebServer is a web server software developed an used in largest polish ISP server farm. This software handles over 205972 domains (according to http://top100.pl/). I hope its worth including support for IdeaWebServer in Wordpress.

Installing Wordpress on IdeaWebServer is easy (as it is mostly apache compatible), but two tweaks need to be done.

Tweak 1st: include IdeaWebServer in $is_apache

Tweak 2nd: use only "http://host/redirect" redirections (no "Location: /somewere", only "Location: http://host/somewere")

Here comes the patch (against r11244):

Index: wp-includes/vars.php
===================================================================
--- wp-includes/vars.php	(wersja 11244)
+++ wp-includes/vars.php	(kopia robocza)
@@ -65,7 +65,9 @@
  * Whether the server software is Apache or something else
  * @global bool $is_apache
  */
-$is_apache = ((strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) || (strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false)) ? true : false;
+$is_apache = ((strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) ||
+(strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false) ||
+(strpos($_SERVER['SERVER_SOFTWARE'], 'IdeaWebServer') !== false)) ? true : false;
 
 /**
  * Whether the server software is IIS or something else
Index: wp-includes/pluggable.php
===================================================================
--- wp-includes/pluggable.php	(wersja 11244)
+++ wp-includes/pluggable.php	(kopia robocza)
@@ -857,6 +857,9 @@
 
 	$location = wp_sanitize_redirect($location);
 
+	if ($location[0] == '/')
+		$location = get_bloginfo('url') . $location;
+
 	if ( $is_IIS ) {
 		header("Refresh: 0;url=$location");
 	} else {

More about this issues (in Polish).

Attachments (1)

plugin.php (911 bytes) - added by kawauso 3 years ago.
Workaround plugin

Download all attachments as: .zip

Change History (19)

comment:1 Denis-de-Bernardy5 years ago

  • Milestone changed from Unassigned to 2.8

comment:2 follow-up: Denis-de-Bernardy5 years ago

  • Keywords reporter-feedback added; has-patch removed
  • Milestone changed from 2.8 to Future Release

This part is not good/potentially buggy:

+	if ($location[0] == '/')
+		$location = get_bloginfo('url') . $location;
+

is it needed, or was it just something you added as an aside?

comment:3 follow-up: burghardt5 years ago

IdeaWebServer seems to not support sending "Location: relative" or "Location: /root". You cannot login (in fact you can, but you will not be redirected to /admin) and after you add comment you did not get back to article you commented. Fortunately redirections like "Location: http://host/root" works.

How it is buggy? Rewriting a redirection to "something" (i.e. without leading "/") will not be prefixed with blog url?

comment:4 in reply to: ↑ 3 Denis-de-Bernardy5 years ago

Replying to burghardt:

How it is buggy? Rewriting a redirection to "something" (i.e. without leading "/") will not be prefixed with blog url?

suppose a blog that's in /wordpress/, with an explicit redirect to /. your code will make it redirect to /wordpress/ instead.

comment:5 Denis-de-Bernardy5 years ago

  • Component changed from Upgrade/Install to General
  • Keywords needs-patch added; reporter-feedback removed

comment:6 Denis-de-Bernardy5 years ago

  • Milestone changed from Future Release to 2.9

comment:7 ryan4 years ago

  • Milestone changed from 2.9 to Future Release

comment:8 follow-up: utnalove3 years ago

  • Severity changed from trivial to normal

Please make a patch or edit the core file so that this web server will be well supported.
I have just subscribed and now.... "surprise" :(
I will be bound with this hosting company for at least other 12 months.

You can see here a some of the many WP blogs hosted under this webserver.

kawauso3 years ago

Workaround plugin

comment:9 in reply to: ↑ 8 ; follow-up: kawauso3 years ago

Replying to utnalove:

Please make a patch or edit the core file so that this web server will be well supported.
I have just subscribed and now.... "surprise" :(
I will be bound with this hosting company for at least other 12 months.

You can see here a some of the many WP blogs hosted under this webserver.

The attached plugin should (in theory at least) workaround the issue without having to modify core files.

comment:10 in reply to: ↑ 9 utnalove3 years ago

Replying to kawauso:

Replying to utnalove:

Please make a patch or edit the core file so that this web server will be well supported.
I have just subscribed and now.... "surprise" :(
I will be bound with this hosting company for at least other 12 months.

You can see here a some of the many WP blogs hosted under this webserver.

The attached plugin should (in theory at least) workaround the issue without having to modify core files.

Thank you. If I try to install it as a normal plugin I get this error:

Incompatible Archive. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

How can I apply the patch?
How can I then test if it works fine?
Will it exclude Apache from the supported web servers or it just adds the support to the new one so that if I will change back to apache WP will continue to work fine?

comment:11 follow-up: dd323 years ago

How can I apply the patch?

You will need to install the plugin via FTP. (The one in the Plugin installer only accepts correctly formatted Zip Archives)

comment:12 in reply to: ↑ 2 hakre3 years ago

Replying to Denis-de-Bernardy:

This part is not good/potentially buggy:

+	if ($location[0] == '/')
+		$location = get_bloginfo('url') . $location;
+

is it needed, or was it just something you added as an aside?

This should not be needed for the webserver technically. I smell that apache might (would be good to know actually) modify the Location: response header with relative URIs into ones with absolute URIs which is the requirement by the HTTP standard.

So this plugin is not only fixing the issue with webserver recognition but also with those parts of the code (those parts have been reduced over the last months however, see #14062, #16909) that do wrong redirects. It's a common mistake and I assume that many plugins are failing here as well. I think that's the reason why this has been added as well, but I can not suggest to take that part in.

Last edited 3 years ago by hakre (previous) (diff)

comment:13 in reply to: ↑ 11 ; follow-up: utnalove3 years ago

Replying to dd32:

You will need to install the plugin via FTP. (The one in the Plugin installer only accepts correctly formatted Zip Archives)

Thanks, installed.
How can I test it to see if it works fine?

comment:14 in reply to: ↑ 13 kawauso3 years ago

Replying to utnalove:

Replying to dd32:

You will need to install the plugin via FTP. (The one in the Plugin installer only accepts correctly formatted Zip Archives)

Thanks, installed.
How can I test it to see if it works fine?

Check if WordPress functions normally I think. Not 100% on what the original changes actually affect, but if permalinks and redirects work, then you're probably fine.

comment:15 utnalove3 years ago

It looks like everything works fine.

Are there chances to include it in the official WP releases?

comment:16 medeis16 months ago

  • Cc medeis added
  • Version 2.7.1 deleted

Hi,

this problem still exists in WP 3.5 nevertheless it was targeted to 2.7.1. Are there any chances to add this finally to the latest build?

Seems that the changes are really small, but are completely solving the issues with IdeaWS.

Thank you.

comment:17 SergeyBiryukov16 months ago

  • Version set to 2.7.1

Version number indicates when the enhancement was initially suggested.

comment:18 nacin3 months ago

  • Component changed from General to Bootstrap/Load
Note: See TracTickets for help on using tickets.