afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-04-08 08:14 am

[dw-free] Invite a Friend page does not allow links to hosted journals

[commit: http://hg.dwscoalition.org/dw-free/rev/f7a7958ceada]

http://bugs.dwscoalition.org/show_bug.cgi?id=716

Fix false positive for detecting external URLs in Invite a Friend

Patch by [personal profile] exor674.

Files modified:
  • htdocs/manage/circle/invite.bml
--------------------------------------------------------------------------------
diff -r bfcc53dbe656 -r f7a7958ceada htdocs/manage/circle/invite.bml
--- a/htdocs/manage/circle/invite.bml	Wed Apr 08 07:24:09 2009 +0000
+++ b/htdocs/manage/circle/invite.bml	Wed Apr 08 08:11:38 2009 +0000
@@ -71,7 +71,7 @@
             unless ( $LJ::USE_ACCT_CODES ) {
                 my $dbh = LJ::get_db_reader();
                 my $ct = $dbh->selectrow_array("SELECT COUNT(*) FROM email WHERE email = ?", undef, $email);
-    
+
                 if ($ct > 0) {
                     my $findfriends_userhasaccount = LJ::run_hook("findfriends_invite_user_has_account");
                     if ($findfriends_userhasaccount) {
@@ -90,9 +90,9 @@
             $bogus->("msg", $ML{'.error.noimagesallowed'});
         }
 
-        foreach ( LJ::get_urls($POST{'msg'}) ) {
-            if ($_ !~ m!^https?://([\w-]+\.)?$LJ::DOMAIN(/.+)?$!i) {
-                $bogus->("msg", "$_<br />" . BML::ml('.error.nooffsitelinksallowed', {'sitename' => $LJ::SITENAMESHORT}));
+        foreach ( LJ::get_urls( $POST{'msg'} ) ) {
+            if ( $_ !~ m!^https?://([\w-]+\.)?$LJ::DOMAIN(/.*)?$!i ) {
+                $bogus->( "msg", "$_<br />" . BML::ml( '.error.nooffsitelinksallowed', { sitename => $LJ::SITENAMESHORT } ) );
                 last;
             }
         }
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org