Page MenuHomePhabricator

Add ability to link back to parent site in external phame blogs
ClosedPublic

Authored by chad on Jun 20 2016, 6:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 3:07 AM
Unknown Object (File)
Fri, May 3, 2:06 AM
Unknown Object (File)
Thu, May 2, 4:02 PM
Unknown Object (File)
Mon, Apr 29, 9:21 PM
Unknown Object (File)
Mon, Apr 29, 1:29 PM
Unknown Object (File)
Mon, Apr 29, 10:50 AM
Unknown Object (File)
Sun, Apr 28, 5:19 AM
Unknown Object (File)
Wed, Apr 24, 9:47 PM
Subscribers

Details

Summary

Ref T9897. Adds a Parent Site and Parent Domain field to allow external sites to link back to parent.

Test Plan

Set up `local.blog.phacility.com```, set parent site to "Phacility" and parent domain to "local.www.phacility.com". Get new crumbs at Blog and Post levels.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

chad retitled this revision from to Add ability to link back to parent site in external phame blogs.
chad updated this object.
chad edited the test plan for this revision. (Show Details)
chad added a reviewer: epriestley.
epriestley edited edge metadata.
epriestley added inline comments.
src/applications/phame/editor/PhameBlogEditEngine.php
105

For consistency, prefer camelCase (parentSite).

113

...and here.

src/applications/phame/editor/PhameBlogEditor.php
159

Then ideally also validate the URI here to make sure it passes PhabricatorEnv::requireValidRemoteURIForLink($uri) before we let them save it.

src/applications/phame/storage/PhameBlog.php
198–202

I think this should just return whatever they entered (so we can link to https://, and a third-party can link to https://corporate.company.com/engineering/ from the "Engineering Blog") but check it first with this:

PhabricatorEnv::requireValidRemoteURIForLink($raw_uri);

That makes sure the user didn't enter javascript:do_evil(); as their parent domain.

This revision now requires changes to proceed.Jun 20 2016, 6:43 PM
chad edited edge metadata.
chad marked 3 inline comments as done.
  • updates per inlines
epriestley edited edge metadata.
epriestley added inline comments.
src/applications/phame/storage/PhameBlog.php
199

We should validate this again here, just to be safe. This prevents these attacks:

  • User figures out how to bypass validation somehow.
  • User figures out some other way to write to the database.
  • There's a bug in requireValidRemoteURIForLink() that we fix later.
This revision is now accepted and ready to land.Jun 20 2016, 7:37 PM
chad marked an inline comment as done.
chad edited edge metadata.
  • Double check URI
This revision was automatically updated to reflect the committed changes.