mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 16:28:01 -05:00
@@ -33,7 +33,7 @@ from r2.lib.menus import *
|
||||
from r2.lib.utils import to36, sanitize_url, check_cheating, title_to_url
|
||||
from r2.lib.utils import query_string, UrlParser, link_from_url, link_duplicates
|
||||
from r2.lib.template_helpers import get_domain
|
||||
from r2.lib.filters import unsafe, _force_unicode
|
||||
from r2.lib.filters import unsafe, _force_unicode, _force_utf8
|
||||
from r2.lib.emailer import has_opted_out, Email
|
||||
from r2.lib.db.operators import desc
|
||||
from r2.lib.db import queries
|
||||
@@ -1343,7 +1343,7 @@ class FormsController(RedditController):
|
||||
if goldtype == "gift":
|
||||
payment_blob["signed"] = signed
|
||||
payment_blob["recipient"] = recipient.name
|
||||
payment_blob["giftmessage"] = giftmessage
|
||||
payment_blob["giftmessage"] = _force_utf8(giftmessage)
|
||||
if comment:
|
||||
payment_blob["comment"] = comment._fullname
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ from pylons import c, g, response
|
||||
from pylons.i18n import _
|
||||
|
||||
from r2.models import *
|
||||
from r2.lib.filters import _force_unicode
|
||||
from r2.lib.utils import randstr
|
||||
from r2.lib.validator import *
|
||||
|
||||
@@ -300,7 +301,7 @@ class IpnController(RedditController):
|
||||
(passthrough, payment_blob["goldtype"]))
|
||||
|
||||
signed = payment_blob["signed"]
|
||||
giftmessage = payment_blob["giftmessage"]
|
||||
giftmessage = _force_unicode(payment_blob["giftmessage"])
|
||||
recipient_name = payment_blob["recipient"]
|
||||
|
||||
if payment_blob["account_id"] != c.user._id:
|
||||
@@ -536,7 +537,7 @@ class IpnController(RedditController):
|
||||
raise ValueError("Invalid recipient_name %s in IPN/GC with custom='%s'"
|
||||
% (recipient_name, custom))
|
||||
signed = payment_blob.get("signed", False)
|
||||
giftmessage = payment_blob.get("giftmessage", False)
|
||||
giftmessage = _force_unicode(payment_blob.get("giftmessage", ""))
|
||||
comment_id = payment_blob.get("comment")
|
||||
send_gift(buyer, recipient, months, days, signed, giftmessage, comment_id)
|
||||
instagift = True
|
||||
|
||||
Reference in New Issue
Block a user