[wp-trac] [WordPress Trac] #27729: error when wordpress is installed in separate directory then started in site root from function

WordPress Trac noreply at wordpress.org
Wed Apr 9 19:08:21 UTC 2014


#27729: error  when wordpress is installed in separate directory then started in
site root from function
--------------------------+------------------------------
 Reporter:  helened       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.8.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Old description:

> When wordpress is installed in it's own directory and is started within a
> function in "index.php" in site root, these errors occur:
>
> This fatal error occurs in WP 3.8.1:
>   [08-Apr-2014 19:34:50 UTC] PHP Fatal error:  Call to a member function
> main() on a non-object in .../mywordpress/wp-includes/functions.php on
> line 808
>

> In WP 3.9-beta3, the error changes to this non-fatal error:
>    [08-Apr-2014 19:53:51 UTC] PHP Warning:  in_array() expects parameter
> 2 to be array, null given in .../mywordpress/wp-includes/kses.php on line
> 1176
>

> Code samples:
> index.php (no error):
> {{{
>    <?php require("mywordpress/index.php");?>
> }}}
>
> index.php (error):
> {{{
> <?php
>     function site_startup(){
>              require("mywordpress/index.php");
>     }
>     site_startup();
>     exit;
> ?>
> }}}
> Tested with PHP 5.4 on Windows (PC XAMPP server) and Linux (Bluehost.com
> server).

New description:

 When wordpress is installed in it's own directory and is started within a
 function in "index.php" in site root, these errors occur:

 This fatal error occurs in WP 3.8.1:
 `[08-Apr-2014 19:34:50 UTC] PHP Fatal error:  Call to a member function
 main() on a non-object in .../mywordpress/wp-includes/functions.php on
 line 808`

 In WP 3.9-beta3, the error changes to this non-fatal error:
 `[08-Apr-2014 19:53:51 UTC] PHP Warning:  in_array() expects parameter 2
 to be array, null given in .../mywordpress/wp-includes/kses.php on line
 1176`

 Code samples:
 index.php (no error):
 {{{
    <?php require("mywordpress/index.php");?>
 }}}

 index.php (error):
 {{{
 <?php
     function site_startup(){
              require("mywordpress/index.php");
     }
     site_startup();
     exit;
 ?>
 }}}
 Tested with PHP 5.4 on Windows (PC XAMPP server) and Linux (Bluehost.com
 server).

--

Comment (by SergeyBiryukov):

 Related: #23685, comment:5:ticket:23685.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27729#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list