Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#641 PHP Fata error cannot use object of type HtmlElement

PHP_error
open
nobody
5
2013-12-06
2012-03-03
No

Seeing a lot o these in my logs on www.hollenback.net:

[Fri Mar 02 22:38:31 2012] [error] [client 199.27.128.228] PHP Fatal error: Cannot use object of type HtmlElement as array in /var/www/phpwiki/lib/CachedMarkup.php on line 559, referer: http://www.google.com/search?q=tag+on+tag+off+clipper+card&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

code:

function _expand($url, $label = false) {
    global $WikiTheme;
    $m = $this->_expandurl($url);
    $class = 'wiki';
    // do not link to the attribute value, but to the attribute
    $is_attribute = ($m[2] == ':='); // this is the line that fails
    if ($WikiTheme->DUMP_MODE and $WikiTheme->VALID_LINKS) {
        if (isset($this->_page) and !in_array($this->_page, $WikiTheme->VALID_LINKS))
            return HTML($label ? $label : ($is_attribute ? $this->_relation : $this->_page));
    }

please give me some advice on how to troubleshoot this. I tried commenting out that line, but that then leads to:

[Sat Mar 03 14:23:05 2012] [error] [client 173.245.55.234] PHP Fatal error: Cannot use object of type HtmlElement as array in /var/www/phpwiki/lib/CachedMarkup.php on line 591, referer: http://www.google.com/search?hl=en&client=safari&sa=X&ei=WJpST4alDojPgAfyrrkr&ved=0CBsQvwUoAQ&q=how+to+connect+directv+to+my+dd-+wrt+router&spell=1&biw=320&bih=416

in the line

     HTML::span(array('class'=>'relation-symbol'), $m[2]),

so it seems that $m[2] does not contain valid data when this happens.

Discussion