Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

upgrade Aspen to 0.39+ #3588

Merged
merged 12 commits into from
Jul 2, 2015
Merged

upgrade Aspen to 0.39+ #3588

merged 12 commits into from
Jul 2, 2015

Conversation

chadwhitacre
Copy link
Contributor

@chadwhitacre
Copy link
Contributor Author

I'm skunked by AspenWeb/pando.py#462 for now. :-(

@chadwhitacre chadwhitacre force-pushed the upgrade-aspen-to-0.40 branch from efec253 to 072a503 Compare June 30, 2015 01:59
@chadwhitacre
Copy link
Contributor Author

Down to one test failure. I'm using an unreleased version of Aspen locally that includes AspenWeb/pando.py#463. I'm waiting to cut a new Aspen release until we're sure we've got a version that's going to work with Gratipay.

@chadwhitacre
Copy link
Contributor Author

I also want to double-check the interaction of redirect_to_base_url and website.redirect.

@chadwhitacre
Copy link
Contributor Author

Here's the diff of the output from master and this branch for the failing test:

--- good.txt    2015-07-01 07:31:09.000000000 -0400
+++ bad.txt 2015-07-01 07:43:17.000000000 -0400
@@ -186,8 +186,8 @@

             <p>To receive money, do something awesome and then tell people about it:</p>
             <ol>
-                <li><a href='/alice/'>Fill out your profile</a> to let others know about you.</li>
-                <li>Reach a wider audience by <a href='/alice/widgets'>embedding our widgets</a> on your blog/website.</li>
+                <li>&lt;a href=&#39;/alice/&#39;&gt;Fill out your profile&lt;/a&gt; to let others know about you.</li>
+                <li>Reach a wider audience by &lt;a href=&#39;/alice/widgets&#39;&gt;embedding our widgets&lt;/a&gt; on your blog/website.</li>
             </ol>
         </div>

@chadwhitacre
Copy link
Contributor Author

In other words, we're escaping HTML when we don't want to.

@chadwhitacre
Copy link
Contributor Author

I believe this has something to do with our i18n plumbing relative to the scoping changes in simplates (see AspenWeb/pando.py#462, etc.).

@chadwhitacre
Copy link
Contributor Author

Hypothesis: the htmlescape function is never making it into the simplate rendering context, because it's being placed in the state dict, which no longer influences rendering context as of AspenWeb/pando.py#463. Therefore, the return value of get_text is a string and not a MarkupSafe (or whatevs), so the autoescaping kicks in and escapes it.

@chadwhitacre
Copy link
Contributor Author

Yeah, it's because the context in the lambdas for {n_,}get_text are bound to state.

@chadwhitacre
Copy link
Contributor Author

I guess we need a new way to influence template context from algorithm functions. Maybe an explicit state['render_context'] reference?

@chadwhitacre chadwhitacre changed the title upgrade Aspen to 0.40 upgrade Aspen to 0.39+ Jul 2, 2015
@chadwhitacre
Copy link
Contributor Author

I also want to double-check the interaction of redirect_to_base_url and website.redirect.

Looking at this now ...

@chadwhitacre chadwhitacre force-pushed the upgrade-aspen-to-0.40 branch from bba1051 to 1c9d542 Compare July 2, 2015 16:05
@chadwhitacre
Copy link
Contributor Author

Rebased on master to pick up #3581.

@chadwhitacre chadwhitacre force-pushed the upgrade-aspen-to-0.40 branch from 84db06a to fca0cf1 Compare July 2, 2015 17:03
@chadwhitacre
Copy link
Contributor Author

Ready for review.

@chadwhitacre
Copy link
Contributor Author

Ping @rohitpaulk @rorepo @kzisme @techtonik et al. I'd like to get this out the door today, because it addresses security issues (we really should've done this in https://github.com/gratipay/security-qf35us before making that public :-( ).

chadwhitacre added a commit that referenced this pull request Jul 2, 2015
@chadwhitacre chadwhitacre merged commit 7e98ebd into master Jul 2, 2015
@chadwhitacre chadwhitacre deleted the upgrade-aspen-to-0.40 branch July 2, 2015 21:04
@chadwhitacre
Copy link
Contributor Author

Proceeding since it's security-related.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant