Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-12-17 04:06:06
- jackysee
- New Member
- Registered: 2004-09-28
- Posts: 5
[textile] Link to a reference cannot use 0
Some problem with the link refernece.
I tried to do this
"yahoo":0
[0]http://www.yahoo.com
It gives me
<a href="">yahoo</a>
Is it related to PHP version?
Offline
Re: [textile] Link to a reference cannot use 0
No, but you can’t link to a zero. What do you expect <a href="0">yahoo</a>
to do? If you’re talking about linking within a page (anchors), then you’d use:
"yahoo":#0
Keep in mind that numbers are invalid id
values, so h2(#0). yahoo's destination
wouldn’t work. You’d need:
"yahoo":#b0
h2(#b0). yahoo's destination
Last edited by jm (2007-12-17 05:48:12)
Offline
#3 2007-12-17 06:30:24
- jackysee
- New Member
- Registered: 2004-09-28
- Posts: 5
Re: [textile] Link to a reference cannot use 0
I think you mis-read my code.
[0] is refer to a link reference below.
"yahoo":0
[0]http://www.yahoo.com
But it WORKS for:
"yahoo":1
[1]http://www.yahoo.com
In the past, it always work for number.
But it seems that after upgrade to PHP 5, it just won’t work for 0.
Of course I can try to avoid that when posting, but the problem is many of my old articles are using [0] as link reference.
Last edited by jackysee (2007-12-17 06:31:27)
Offline
Re: [textile] Link to a reference cannot use 0
Doesn’t work with PHP4.3 either, so it’s not PHP related.
Offline
#5 2007-12-17 18:28:27
- jackysee
- New Member
- Registered: 2004-09-28
- Posts: 5
Re: [textile] Link to a reference cannot use 0
I take a look at the code, it seems that line 801 of classTextile.php is causing this problem.
function shelveURL($text)
{
if (!$text) return '';
$ref = md5($text);
$this->urlshelf[$ref] = $text;
return 'urlref:'.$ref;
}
The first if will return true even for string ‘0’. i.e. (!'0')
is true.
If that checking is just to prevent empty string, it can use $test==''
Last edited by jackysee (2007-12-17 18:30:30)
Offline
#6 2007-12-17 18:48:23
- jackysee
- New Member
- Registered: 2004-09-28
- Posts: 5
Re: [textile] Link to a reference cannot use 0
Don’t know if it’s appropriate, I reported the bug at the textile page.
Offline
Re: [textile] Link to a reference cannot use 0
is zem even supporting textile anymore?
Last edited by iblastoff (2007-12-17 18:50:39)
Offline
Re: [textile] Link to a reference cannot use 0
Yes, as far as I know, although if there’s a bug that’s easy to fix, I can commit changes as well (as can any of the other TXP devs).
Offline