boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Recently updated list not escaped enough
Goto page 1, 2  Next
 
Post new topic   Reply to topic    boardom Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
mikelittle



Joined: 11 May 2002
Posts: 376
Location: UK

PostPosted: Mon Aug 19, 2002 10:04 pm    Post subject: Recently updated list not escaped enough Reply with quote

Michel,
The recently updated list which now includes the subject of the most recent blog as a tool tip (great idea by the way), needs some more html chars escaping in it.

It's stopping my page form validating.

For instance someone had used italic tags in their subject. resulting in <i> in the tooltip. As this ends up inside an attribute of the anchor tag, it needs escaping to be <i>

Thanks,

Mike
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
michel v
Site Admin


Joined: 25 Jan 2002
Posts: 799
Location: Corsica

PostPosted: Tue Aug 20, 2002 12:32 pm    Post subject: Reply with quote

Oops. Off to update this.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
.Chris



Joined: 30 Apr 2002
Posts: 186
Location: Hawaii

PostPosted: Tue Aug 20, 2002 6:51 pm    Post subject: Reply with quote

Is there any way to limit the output? Instead of 50 something links just 10 or 20? Not in the main output, just in the way it shows up on your own site.
Back to top
View user's profile Send private message Visit poster's website
michel v
Site Admin


Joined: 25 Jan 2002
Posts: 799
Location: Corsica

PostPosted: Wed Aug 21, 2002 12:48 am    Post subject: Reply with quote

[php:1:ee4e812d8c]<?php

$how_many_links = 20;

$b2updates = file('http://cafelog.com/changes.php');
for($i=0; $i<$how_many_links; $i++) {
echo $b2updates[$i]."\n";
}

?>[/php:1:ee4e812d8c]
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
mikelittle



Joined: 11 May 2002
Posts: 376
Location: UK

PostPosted: Wed Aug 21, 2002 1:02 am    Post subject: Reply with quote

Thanks Michel.

A very useful tip.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
.Chris



Joined: 30 Apr 2002
Posts: 186
Location: Hawaii

PostPosted: Wed Aug 21, 2002 1:09 am    Post subject: Reply with quote

Thanks Michel!

(I can't help but feel stupid, I probibly could have found that on the net somewhere.)
Back to top
View user's profile Send private message Visit poster's website
dotdotspace



Joined: 15 Mar 2002
Posts: 138
Location: Seattle, WA

PostPosted: Thu Aug 29, 2002 1:26 am    Post subject: Reply with quote

my only problem with this code (and note: windows, iis 5, php4.2.2 or 4.2.3) was that the for loop would show as many links as $how_many_links defined, minus 1. so i was getting 19 links when i wanted 20 (as an example).

my quick code mod lies on line 5, where the second expression was "$i<$how_many_links", it is now:

[php:1:5e7896087a]<?php

$how_many_links = 25;

$b2updates = file('http://cafelog.com/changes.php');
for($i=0; $i<=$how_many_links; $i++) {
echo $b2updates[$i]."\n";
}

?>[/php:1:5e7896087a]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
michel v
Site Admin


Joined: 25 Jan 2002
Posts: 799
Location: Corsica

PostPosted: Thu Aug 29, 2002 3:19 am    Post subject: Reply with quote

This is pretty weird.
According to the original loop, $i goes from 0 to 24, since [0] is the first element of the array and [24] is the 25th.
Try putting echo $i; in the loop to see which values $i is assigned as the loop rolls. It just doesn't seem right that it displays only 24 elements...
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
dotdotspace



Joined: 15 Mar 2002
Posts: 138
Location: Seattle, WA

PostPosted: Thu Aug 29, 2002 3:43 am    Post subject: Reply with quote

yeah i was confused too, but my mod seems to have fixed it. either way, it works now.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dotdotspace



Joined: 15 Mar 2002
Posts: 138
Location: Seattle, WA

PostPosted: Thu Aug 29, 2002 8:03 pm    Post subject: Reply with quote

and today i just saw that the script was outputting 26 instead of 25.. odd, seeing as how it did not do that yesterday. so the code is back to the way you gave it, michel. odd, again.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mikelittle



Joined: 11 May 2002
Posts: 376
Location: UK

PostPosted: Fri Aug 30, 2002 12:42 am    Post subject: Reply with quote

I too noticed that it would sometimes output one less than expected.

When I last noticed it, my page would not pass muster as XHTML compliant.

Looking into it I discovered that the last entry was an incomplete tag.

It appears that if the name of the blog has a new line in it, the code which returns an array of strings counts that as two lines, therefore two entries in the array. Hence you get one less link output.

Sorry I didn't report it at the time, I must have been busy.

Now if only I could remember which blog it was...
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
dotdotspace



Joined: 15 Mar 2002
Posts: 138
Location: Seattle, WA

PostPosted: Fri Aug 30, 2002 6:56 am    Post subject: Reply with quote

mine list is exiting at either Lele's (drollery.lethien.com) or the Alicia Keyes Fan - Live News (akf.monosyllabically.com) blogs. the output is
Quote:
7-8. Lele
9-9. Alicia Keys Fan - Live News

the code to output this is in the for loop:
[php:1:a5c748869b]for($i=0; $i<$how_many_links; $i++) {
echo $i."-";
echo $b2updates[$i]."\n";
}[/php:1:a5c748869b]

so we know where it's escaping, but why (most likely a newline somewhere) is another story.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dotdotspace



Joined: 15 Mar 2002
Posts: 138
Location: Seattle, WA

PostPosted: Sat Aug 31, 2002 9:37 pm    Post subject: Reply with quote

ideas?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mikelittle



Joined: 11 May 2002
Posts: 376
Location: UK

PostPosted: Sat Aug 31, 2002 10:08 pm    Post subject: Reply with quote

As I mentioned previously. Some of the url's seem to have newlines in them.

Right this minute, the most recently updated is Lele's site. The code comes out like this:
Code:

    <h4>recently updated b2 blogs</h4>
1. <a href="http://drollery.lethien.com
" title="Updated @ 20:30 GMT - Last post : 'Guess who\'s back, back again...'">Lele</a><br />
2. <a href="http://www.adamwalker.34sp.com/index.php" title="Updated @ 20:13 GMT - Last post : 'b2archives hack V1.02'">The B2 Dev Suite</a><br />


Note that there is a newline before the closing quote in the first href.

Here's one theory:
I'm guessing that the registered users who ping cafelog.tidakada.com are stored in a database somewhere. It would seem that some entries have a newline at the ned of them thus when the software retrieves the data and outputs it as html, we get the effect above.

If this IS the case I guess Michel needs to clean his database.

Hope this helps,

Mike
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
.Chris



Joined: 30 Apr 2002
Posts: 186
Location: Hawaii

PostPosted: Sat Aug 31, 2002 10:14 pm    Post subject: Reply with quote

It doesn't do any of the things you all have discribed seeing it doing for me?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Bugs All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group