Ticket #558 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

themes.php logic fails on windows server

Reported by: so1o Owned by: 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 Download (1.5 KB) - added by so1o 5 years ago.
Changes for the fix..

Change History

comment:1   so1o5 years ago

  • Owner set to so1o
  • Status changed from new to assigned

comment:2   so1o5 years ago

  • Keywords has-patch added

added patch for the fix

so1o5 years ago

Changes for the fix..

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?

comment:4   so1o5 years ago

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 :)

[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.

  • Status changed from assigned to closed
  • Resolution set to fixed

Marking this as fixed.

Reopen if problem persists.

comment:7   so1o5 years ago

  • Status changed from closed to reopened
  • Resolution fixed deleted

Damn windows!

#625 maybe related

comment:8   so1o5 years ago

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?

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

comment:10 follow-up: ↓ 11   mdawaffe5 years ago

Also, what version of web server, PHP?

comment:11 in reply to: ↑ 10 ; follow-up: ↓ 15   so1o5 years ago

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

  • Milestone changed from 0.80 to 0.8.2

so1o,

on that same line, can you

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

Also, is WordPress being loaded? What version?

comment:15 in reply to: ↑ 11   so1o5 years ago

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..

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

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/"
}

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

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

  • Status changed from reopened to closed
  • Resolution set to fixed

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

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

Note: See TracTickets for help on using tickets.