Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs / Tests for Director::absoluteURL #3011

Merged
merged 1 commit into from
Apr 7, 2014

Conversation

tractorcow
Copy link
Contributor

$this->assertStringStartsNotWith('javascript', Director::absoluteURL('alert("attack")'));
$this->assertStringStartsNotWith('alert', Director::absoluteURL('alert("attack")'));

Director::setBaseURL(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it definitely safe to just reset this to false instead of remembering previous value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting it to false removes the 'override' ($alternateBaseURL) and reverts to the default behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll move it to tearDown, which is where it really should be. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boom, done. At least the environment won't be corrupted if this test case fails.

hafriedlander pushed a commit that referenced this pull request Apr 7, 2014
Docs / Tests for Director::absoluteURL
@hafriedlander hafriedlander merged commit 5b0a969 into silverstripe:3.0 Apr 7, 2014
@tractorcow
Copy link
Contributor Author

Thanks @hafriedlander !

@tractorcow tractorcow deleted the pulls/absurl branch April 22, 2014 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants