Status: offline

ByteEnable

Forum User
Full Member
Registered: 10/20/03
Posts: 138
When I have URL rewite on, stories fail to page with [page_break].

URL Class: number of names passed to setArgNames must be equal or greater than number of arguments found in URL

Byte
LinuxElectrons™

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Works for me ...

Which PHP version? Webserver?

bye, Dirk

Status: offline

ByteEnable

Forum User
Full Member
Registered: 10/20/03
Posts: 138
openSuse Version 10

PHP:

PHP 4.4.0 (cli) (built: Sep 6 2005 00:49:01)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

Apache:

Server version: Apache/2.0.54
Server built: Sep 4 2005 00:24:17

Pear:

Installed packages:
===================
Package Version State
Archive_Tar 1.3.1 stable
Console_Getargs 1.3.0 stable
Console_Getopt 1.2 stable
DB 1.7.6 stable
HTTP_Request 1.2.4 stable
Mail 1.1.8 stable
Net_SMTP 1.2.7 stable
Net_Socket 1.0.6 stable
Net_URL 1.0.14 stable
PEAR 1.3.6 stable
XML_RPC 1.4.1 stable

Byte
LinuxElectrons™

tokyoahead

Anonymous
Please post the URL of the second page (or the page that returns the error)

Status: offline

ByteEnable

Forum User
Full Member
Registered: 10/20/03
Posts: 138
Quote by tokyoahead: Please post the URL of the second page (or the page that returns the error)


The test site is not available from the Internet. The second page url looks like the following:

http://www.test.com/200534566788/2

Note: This is GL1.3.12CVS code.

Byte
LinuxElectrons™

Status: offline

ByteEnable

Forum User
Full Member
Registered: 10/20/03
Posts: 138
Debugging the code, I found why it fails, but I don't completely understand the code.

When article.php calls COM_siteHeader, COM_siteHeader eventually executes the following:

Text Formatted Code

if( empty( $sid ) && $_CONF['url_rewrite'] )
        {
            COM_setArgNames( array( 'story'));
            $sid = COM_applyFilter( COM_getArgument( 'story' ));
        }

 


The COM_setArgNames only has one variable in the array which causes the if/then
in url.class.php to be true, because $this->_arguments = 2.

Text Formatted Code

function setArgNames($names)
    {
        if (count($names) < count($this->_arguments)) {
            print "URL Class: number of names passed to setArgNames must be equal or greater than number of arguments found in URL";
            exit;
        }

 


So as a work around I added an empty string in COM_siteHeader like so

Text Formatted Code

COM_setArgNames( array( 'story',''));

 


Byte
LinuxElectrons