Subject: | user_name test fails; patch included |
Date: | Wed, 07 May 2008 23:33:04 +0100 |
To: | bug-www-myspace [...] rt.cpan.org |
From: | Steven Chamberlain <steven [...] pyro.eu.org> |
Hi,
My test account has a display name of "TestDisplayName" but MySpace now
show this as "TestDisp<wbr/>layName" in the HTML of the 'user home'
page. That isn't a real HTML tag, so it's either a typo, or MySpace
have decided to make up their own HTML tags now. I think its purpose is
to allow the display name to break onto the next line.
This was causing the user_name test in t/01-login.t to fail. My
attached patch strips out this tag if present, and it should still work
if they ever change it to <br/> in the future.
Regards,
--
Steven Chamberlain
steven@pyro.eu.org
Index: lib/WWW/Myspace.pm
===================================================================
--- lib/WWW/Myspace.pm (revision 578)
+++ lib/WWW/Myspace.pm (working copy)
@@ -1378,6 +1378,11 @@
# $line =~ s/\+/ /g;
# $line =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$self->{user_name} = $2;
+
+ # 2008-04-14 -- have noticed Myspace inserting <wbr/> randomly
+ # in the middle of the user's name on the homepage; these need to
+ # be stripped out
+ $self->{user_name} =~ s/<wbr\/>//ig;
}
}