Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-26 18:12:27

jam_izzy
New Member
Registered: 2005-09-22
Posts: 2

sgb_url_handler 0.1.8.4 broken!

I’ve been using sgb_url_handler to make my clean urls work. It has done a great job. I recently moved our site to a new business server with PHP 5.0.5, and when I loaded it all up I got this error:

Fatal error: Only variables can be passed by reference in /users/home/memorymixer/web/public/textpattern/lib/txplib_misc.php(429) : eval()’d code on line 84

Does anyone have any recommendations on either fixing this… or using another method for clean urls? I’m not that PHP savy, though I can get by. What would you recommend?

Last edited by jam_izzy (2006-01-26 18:13:10)

Offline

#2 2006-01-27 01:18:04

takshaka
Archived Plugin Author
From: Below the Manson-Nixon line
Registered: 2004-06-02
Posts: 97
Website

Re: sgb_url_handler 0.1.8.4 broken!

The line in question is—

<blockquote><code>$r = trim(array_shift(explode(‘?’, $_SERVER[‘REQUEST_URI’])), ‘/’);</code>
</blockquote>

5.0.5 broke many array_* functions, so you’ll have to change it to something like this:

<blockquote><code>$tmp = explode(‘?’, $_SERVER[‘REQUEST_URI’]);
$r = trim(array_shift($tmp), ‘/’);
</code></blockquote>

Line 111 may throw an error as well.

<blockquote><code>$a[$k] = array_flip(explode(‘/’, $v));</code>

becomes

<code>$tmp = explode(‘/’, $v);
$a[$k] = array_flip($tmp);
</code></blockquote>

Offline

#3 2006-01-27 06:56:04

jam_izzy
New Member
Registered: 2005-09-22
Posts: 2

Re: sgb_url_handler 0.1.8.4 broken!

That got rid of that error! Thanks a bunch. :) Now I have two more though… lol. I’m working on it right now, but I would appreciate any help still.

A problem occured while loading the plugin: sgb_url_handler -> Notice: Undefined index: id

A problem occured while loading the plugin: sgb_url_handler -> Notice: Undefined index: category2

Thanks, again, by the way. I really appreciate it. My brain’s “bandwidth” is kinda low right now as I’m trying to start a company, finish school, and get married all at the same time. I would love it if this code was Ruby instead of PHP!

Last edited by jam_izzy (2006-01-27 06:57:07)

Offline

#4 2006-01-28 21:46:21

takshaka
Archived Plugin Author
From: Below the Manson-Nixon line
Registered: 2004-06-02
Posts: 97
Website

Re: sgb_url_handler 0.1.8.4 broken!

jam_izzy wrote:
I would love it if this code was Ruby instead of PHP!

Almost anything is better than PHP.

If you set your production status to ‘Live’ the warnings will be quietly ignored. I haven’t really looked at the plugin code beyond searching for ‘array_’, so I assume those warnings are normal.

Offline

Board footer

Powered by FluxBB