Hi,
Some time ago I wrote a script in php to read an xml stream, parse the data into the format that I required and present it to the user.
For the most part, there are no problems but, there is one field of each record that does cause challenges. The data stream comes from a game that is played online called 'VSK5 America's cup challenge' and is a list of all registered players giving their login-names (no problem) and their 'boat-name' - problem!!!
The boat name is allowed to be 'formatted' by the user both for bold,italic etc., and colour. The formatting uses the syntax shown here: http://vsk.diades.net/formatting.php and, as long as the formatting is used correctly all is ok but, these users are not all 'disciplined' as regards formatting and that is where the mess up occur. If you go here: http://www.diades.net/vsk-rankings.php where the script is in action there is, at the moment, a 'broken' name in the script that is causing a problem on the layout.
The user
is obviously using unmatched quote makes (no rules for that) , here is the actual 'script for the login name shown:Code:" K3y 77 - Poppy " "
Another as shown on the page:Code:$s $f00 " K3y 77 - Poppy " "
As you see, most of the formatting in this instance is being ignored (perhaps because there are newline chars in there?. Again the actual unparsed login:Code:ita_ pa o LO $m$i$0f0 (v$fffsk$f03a$f00)
$0f0ITA_$fffPA$f00OLO $m$i$0f0 (v$fffsk$f03a$f00)Code:$0f0ITA_$fffPA$f00OLO $m$i$0f0 (v$fffsk$f03a$f00)
The red above showing the formatting codes.
I have attached the file, the whole script requires upgrading from php4 to php5 which is on my todo list but it is the parsing of the formatting that is bugging me if anyone can help overcome the nasties.



Reply With Quote
Bookmarks