Ticket #558 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

themes.php logic fails on windows server

Reported by: so1o Assigned to: so1o
Priority: high Milestone: 0.8.2
Component: Back-end Version:
Severity: critical Keywords: has-patch
Cc:

Description

if ( !in_array($activetheme, $themes)) {

this will fail because $activetheme is set to E:\\server\\forums/bb-templates/xxxxx and array $themes has it as E:\server\forums/bb-templates/xxxxx

Attachments

ticket-558.patch (1.5 kB) - added by so1o on 01/24/07 03:35:42.
Changes for the fix..

Change History

01/24/07 01:03:40 changed by so1o

  • owner set to so1o.
  • status changed from new to assigned.

01/24/07 01:42:40 changed by so1o

  • keywords set to has-patch.

added patch for the fix

01/24/07 03:35:42 changed by so1o

  • attachment ticket-558.patch added.

Changes for the fix..

01/27/07 18:30:59 changed by mdawaffe

The problem I was trying to solve by storing the full path is that my-templates/ and bb-templates/ may both have a theme with the same name in it. The user should still be able to select either.

Of course, in looking back at that code, that's impossible; directories in my-templates override directories in bb-templates.

Thoughts?

01/27/07 21:29:36 changed by so1o

yup i saw that.. and this patch will still make that work.. i have tried it with my themes.. my themes are in my-templates folder

the only issue i see is when you have same theme folder in both.. that is just plain stupid :)

02/02/07 00:04:39 changed by mdawaffe

[654] May fix this issue.

I'd like to keep the full path in the option if possible. That way we don't have to do bb_get_themes() (which has to access the filesystem) every time bb_get_active_theme_folder() is called.

02/05/07 21:41:36 changed by mdawaffe

  • status changed from assigned to closed.
  • resolution set to fixed.

Marking this as fixed.

Reopen if problem persists.

06/03/07 22:26:49 changed by so1o

  • status changed from closed to reopened.
  • resolution deleted.

Damn windows!

#625 maybe related

06/03/07 23:54:59 changed by so1o

source:trunk/bb-includes/wp-functions.php

var_dump($query);
parse_str($query, $qs);
if ( get_magic_quotes_gpc() )
	$qs = stripslashes_deep($qs); 
var_dump($qs);

shows

string(65) "theme=J%3A%5Cdev%5Cwordpress%5Cforums%2Fbb-templates%2Fkakumei%2F"
array(1) {
  ["theme"]=>
  string(54) "J:\\dev\\wordpress\\forums/bb-templates/kakumei/"
}

shouldn't it be

string(65) "theme=J%3A%5Cdev%5Cwordpress%5Cforums%2Fbb-templates%2Fkakumei%2F"
array(1) {
  ["theme"]=>
  string(54) "J:\dev\wordpress\forums/bb-templates/kakumei/"
}

any insight any one?

06/06/07 18:22:33 changed by mdawaffe

so1o, are you running Apache on Windows or IIS? I forget.

(follow-up: ↓ 11 ) 06/06/07 18:23:49 changed by mdawaffe

Also, what version of web server, PHP?

(in reply to: ↑ 10 ; follow-up: ↓ 15 ) 06/06/07 18:32:28 changed by so1o

Replying to mdawaffe:

Also, what version of web server, PHP?

I'm on Apache HTTPD 2.2.4, PHP 4.4.7

i'll try and check with PHP 5.2.2 if its gives the same issue

06/08/07 19:55:35 changed by mdawaffe

  • milestone changed from 0.80 to 0.8.2.

06/11/07 23:31:24 changed by mdawaffe

so1o,

on that same line, can you

var_dump( get_magic_quotes_gpc() );
var_dump( get_magic_quotes_runtime() );

06/13/07 06:04:44 changed by mdawaffe

Also, is WordPress being loaded? What version?

(in reply to: ↑ 11 ) 06/13/07 13:52:37 changed by so1o

Replying to so1o:

I'm on Apache HTTPD 2.2.4, PHP 4.4.7 i'll try and check with PHP 5.2.2 if its gives the same issue

my bad on this one.. the php which gave me error was running was 5.2.2.. but it doesnt give me the error on 4.4.7

Replying to mdawaffe:

var_dump( get_magic_quotes_gpc() ); var_dump( get_magic_quotes_runtime() );

var dump give me this

int(1)
int(0)

Replying to mdawaffe:

Also, is WordPress being loaded? What version?

nope no wordpress..

06/13/07 13:55:26 changed by so1o

and in both the versions of php the vardump is the same.

06/13/07 14:01:14 changed by so1o

I added another variable dump

var_dump($query);
parse_str($query, $qs);
var_dump($qs);
if ( get_magic_quotes_gpc() )
	$qs = stripslashes_deep($qs); 
var_dump($qs);

here is the output!

string(65) "theme=J%3A%5Cdev%5Cwordpress%5Cforums%2Fbb-templates%2Fkakumei%2F"
array(1) {
  ["theme"]=> string(54) "J:\\\\dev\\\\wordpress\\\\forums/bb-templates/kakumei/"
}
array(1) {
  ["theme"]=> string(48) "J:\\dev\\wordpress\\forums/bb-templates/kakumei/"
}

06/13/07 14:11:19 changed by so1o

did some research.. looks like its a bug..

http://bugs.php.net/bug.php?id=39763

06/14/07 19:11:03 changed by mdawaffe

06/15/07 01:31:33 changed by mdawaffe

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [851]) bring wp funcs up to date. wp_parse_str(). Fixes #558

06/15/07 01:31:59 changed by mdawaffe

This is now pluggable in wp_parse_str() to work around any PHP bugs.