Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

408: foreach($Paths as $Path) { error in library/core/class.pluginmanager.php

edited November 2009 in Vanilla 2.0 - 2.8
just got off the phone with you Mark... thanks for trying to help me remotely.

in all it's glory here :

http://hype.joshuadavis.com/forum/

I've read through all of the other posts - nothing fixes this problem. deleted the plugins, re-installed, etc., etc.

running :

MySQL - 5.0.45

Application: Garden
Application Version: 1.0
PHP Version: 5.2.6
Operating System: Linux
User Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9
Request Uri: /forum/
Controller: PHP
Method: ErrorHandler

--

Variables in local scope:
[EnabledPlugins] array (
'HTMLPurifier' => 'HtmlPurifier',
)
[Paths] NULL
[PluginFolder] 'HtmlPurifier'
[PluginName] 'HTMLPurifier'
[PluginInfo] array (
)

Comments

  • Options
    MarkMark Vanilla Staff
    edited November 2009
    Add this on line 405 of library/core/class.pluginmanager.php:
    if (!is_array($Paths))
    $Paths = array();
    It doesn't fix the source of the problem, but it should get you functional.
  • Options
    thanks for helping me out mark... now I get a new error...

    http://hype.joshuadavis.com/forum/

    // Get a list of files to include.
    400: $Paths = array();
    401: foreach ($EnabledPlugins as $PluginName => $PluginFolder) {
    402: $Paths[] = PATH_PLUGINS . DS . $PluginFolder . DS . 'default.php';
    403: $Paths = array_merge($Paths, Glob(PATH_PLUGINS . DS . $PluginFolder . DS . '*plugin.php'));
    404: }
    405:
    406: if (!is_array($Paths))
    407: $Paths = array();
  • Options
    I'm having the same problem. Here's additional info:

    Fatal Error in PHP.ErrorHandler();
    array_merge() [function.array-merge]: Argument #2 is not an array
    The error occurred on or near: /home/[myuser]/domains/[mysite]/public_html/library/core/class.pluginmanager.php

    399: // Get a list of files to include.

    400: $Paths = array();

    401: foreach ($EnabledPlugins as $PluginName => $PluginFolder) {

    402: $Paths[] = PATH_PLUGINS . DS . $PluginFolder . DS . 'default.php';

    403: $Paths = array_merge($Paths, Glob(PATH_PLUGINS . DS . $PluginFolder . DS . '*plugin.php'));

    404: }

    405: if (!is_array($Paths))

    406: $Paths = array();

    407:

    Backtrace:

    [/home/[myuser]/domains/[mysite]/public_html/library/core/functions.error.php:124] PHP::include();

    [/home/[myuser]/domains/[mysite]/public_html/library/core/functions.error.php:124] PHP::ErrorHandler();

    [/home/[myuser]/domains/[mysite]/public_html/library/core/class.pluginmanager.php:403] PHP::array_merge();

    [/home/[myuser]/domains/[mysite]/public_html/bootstrap.php:128] Gdn_PluginManager->IncludePlugins();

    [/home/[myuser]/domains/[mysite]/public_html/index.php:26] PHP::require_once();

    Variables in local scope:

    [EnabledPlugins] array (
    'HTMLPurifier' => 'HtmlPurifier',
    )

    [Paths] array (
    0 => '/home/[myuser]/domains/[mysite]/public_html/plugins/HtmlPurifier/default.php',
    )

    [PluginFolder] 'HtmlPurifier'

    [PluginName] 'HTMLPurifier'

    Need Help?

    If you are a user of this website, you can report this message to a website administrator.

    If you are an administrator of this website, you can get help at the Lussumo Community Forums.
    Additional information for support personnel:

    * Application: Garden
    * Application Version: 1.0
    * PHP Version: 5.2.11
    * Operating System: Linux
    * User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)
    * Request Uri: /settings
    * Controller: PHP
    * Method: ErrorHandler





    library/core/class.pluginmanager.php already has that included. Also, the "Here's some stuff you might want to do:" menu shows in HTML.
  • Options
    MarkMark Vanilla Staff
    What web server are you guys using?

    The second parameter into that function is returned by php's glob() function, and that function only fails to return an array if there is an error of some kind. So, there is some wacky error on your web server causing that to fail. Any chance you could debug it to find out why that's happening?
  • Options
    MarkMark Vanilla Staff
    You know what? Try this:

    Open library/core/functions.general.php, find line 817, and change it to this:
    if (!function_exists('Glob')) {
    function Glob($Pattern, $Flags = 0) {
    $Return = glob($Pattern, $Flags);
    if (!is_array($Return))
    $Return = array();

    return $Return;
    }
    }
  • Options
    MarkMark Vanilla Staff
    btw - I wouldn't be surprised if we find more errors after this. There seems to be something funky going on with your web servers or your php versions.
  • Options
    Tried that, nothing changed - same error. Here's my phpinfo; I'm not sure how to debug it but I'll ask my host.

    (BTW, the first "Download Now!" link is an ad, the "Download" button right under it is the download link. - No wait times.)
    http://www.plunder.com/phpinfo-txt-download-2eaa594581.htm
  • Options
    edited November 2009
    In php all functions are case-insensitive, so when you write:
    if (! function_exist('Glob'))
    {
    ...
    }
    commands in brackets will never be executed because there is a function php-core glob.

    Accordingly, in the /library/core/class.pluginmanager.php, line 403, is always called glob (not Glob), which in case of error returns false, causing the error in the function array_merge.
  • Options
    Yeah, Alaris is right, that condition will never run on a standard PHP install. Makes me wonder what you've done to your server to make it work?

    Anyway, without changing the code, I was able to get things going by creating empty "plugin.php" files in the HtmlPurifier and GettingStarted plugins, which makes the call to PHP's glob() return an array instead of FALSE. Simply:

    touch plugins/GettingStarted/plugin.php touch plugins/HtmlPurifier/plugin.php

    FWIW, here's some info on our setup:

    * SliceHost 256 slice, Arch Linux. (the only Linux distro that doesn't make me want to kill puppies)

    # php -v PHP 5.2.9 with Suhosin-Patch 0.9.7 (cli) (built: Mar 5 2009 23:16:48) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies with the ionCube PHP Loader v3.1.34, Copyright (c) 2002-2009, by ionCube Ltd., and with XCache v1.2.2, Copyright (c) 2005-2007, by mOo # httpd -v Server version: Apache/2.2.11 (Unix) Server built: Jan 29 2009 14:57:59 # mysqld --version mysqld Ver 5.0.77-log for unknown-linux-gnu on x86_64 (Source distribution) # uname -a Linux www.foxycart.com 2.6.24-23-xen #1 SMP Mon Jan 26 03:09:12 UTC 2009 x86_64 Quad-Core AMD Opteron(tm) Processor 2350 HE AuthenticAMD GNU/Linux

    Anyway, what's the beef? How come you get case-sensitive PHP builtin functions and the rest of us get standard behaviour? :-)
  • Options
    MarkMark Vanilla Staff
    So strange! I'll fix that in the core right away..
  • Options
    Hi,

    I just downloaded the source from the git repository and I have the same issue. How to solve this ?

    I'm running on PHP 5.3.1 with Suhosin-Patch (cli) (built: Nov 23 2009 21:12:00) on Arch Linux.
  • Options
    hi,
    I have a problem in my server. Its apache 2.2.11 .
    The problem is in +include in shtml.
    an unknown error occured : +include.

    Please help send me the your views.

    Meenakshi Nigam
Sign In or Register to comment.