Skip to content

Check if umask is 000 in brew doctor #119

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

Merged
merged 4 commits into from
Nov 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ If you rely on the $modelValue validation, you can overwrite the `min`/`max` val
link: function(scope, element, attrs, ctrl) {
var maxValidator = ctrl.$validators.max;

ctrk.$validators.max = function(modelValue, viewValue) {
ctrl.$validators.max = function(modelValue, viewValue) {
return maxValidator(modelValue, modelValue);
};
}
Expand Down Expand Up @@ -1579,7 +1579,7 @@ If you rely on the $modelValue validation, you can overwrite the `min`/`max` val
link: function(scope, element, attrs, ctrl) {
var maxValidator = ctrl.$validators.max;

ctrk.$validators.max = function(modelValue, viewValue) {
ctrl.$validators.max = function(modelValue, viewValue) {
return maxValidator(modelValue, modelValue);
};
}
Expand Down
2 changes: 1 addition & 1 deletion docs/content/guide/migration.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ custom directive, as seen in the following example directive definition object:
link: function(scope, element, attrs, ctrl) {
var maxValidator = ctrl.$validators.max;

ctrk.$validators.max = function(modelValue, viewValue) {
ctrl.$validators.max = function(modelValue, viewValue) {
return maxValidator(modelValue, modelValue);
};
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@
"npm-run": "^4.1.0",
"open-sans-fontface": "^1.4.0",
"promises-aplus-tests": "~2.1.0",
"protractor": "^5.1.2",
"protractor": "^5.4.1",
"q": "~1.0.0",
"q-io": "^1.10.9",
"qq": "^0.3.5",
"rewire": "~2.1.0",
"sax": "^1.1.1",
"selenium-webdriver": "^2.53.1",
"selenium-webdriver": "^4.0.0-alpha.1",
"semver": "^5.4.1",
"serve-favicon": "^2.3.0",
"serve-index": "^1.8.0",
Expand Down
5 changes: 3 additions & 2 deletions src/AngularPublic.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

htmlAnchorDirective,
inputDirective,
inputDirective,
hiddenInputBrowserCacheDirective,
formDirective,
scriptDirective,
selectDirective,
Expand Down Expand Up @@ -221,7 +221,8 @@ function publishExternalAPI(angular) {
ngModelOptions: ngModelOptionsDirective
}).
directive({
ngInclude: ngIncludeFillContentDirective
ngInclude: ngIncludeFillContentDirective,
input: hiddenInputBrowserCacheDirective
}).
directive(ngAttributeAliasDirectives).
directive(ngEventDirectives);
Expand Down
42 changes: 42 additions & 0 deletions src/ng/directive/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -2193,6 +2193,48 @@ var inputDirective = ['$browser', '$sniffer', '$filter', '$parse',
}];


var hiddenInputBrowserCacheDirective = function() {
var valueProperty = {
configurable: true,
enumerable: false,
get: function() {
return this.getAttribute('value') || '';
},
set: function(val) {
this.setAttribute('value', val);
}
};

return {
restrict: 'E',
priority: 200,
compile: function(_, attr) {
if (lowercase(attr.type) !== 'hidden') {
return;
}

return {
pre: function(scope, element, attr, ctrls) {
var node = element[0];

// Support: Edge
// Moving the DOM around prevents autofillling
if (node.parentNode) {
node.parentNode.insertBefore(node, node.nextSibling);
}

// Support: FF, IE
// Avoiding direct assignment to .value prevents autofillling
if (Object.defineProperty) {
Object.defineProperty(node, 'value', valueProperty);
}
}
};
}
};
};



var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
/**
Expand Down
13 changes: 13 additions & 0 deletions test/e2e/fixtures/back2dom/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html ng-app="test">
<body ng-class="{hacked: internalFnCalled}">
<form>
<input id="input1" type="hidden" value="{{value}}" />
<input id="input2" type="hidden" ng-value="value" />

<textarea ng-model="value"></textarea>
</form>
<script src="angular.js"></script>
<script src="script.js"></script>
</body>
</html>
11 changes: 11 additions & 0 deletions test/e2e/fixtures/back2dom/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';

angular
.module('test', [])
.run(function($rootScope) {
$rootScope.internalFnCalled = false;

$rootScope.internalFn = function() {
$rootScope.internalFnCalled = true;
};
});
68 changes: 68 additions & 0 deletions test/e2e/tests/input-hidden.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,72 @@ describe('hidden thingy', function() {
var expectedValue = browser.params.browser === 'safari' ? '{{ 7 * 6 }}' : '';
expect(element(by.css('input')).getAttribute('value')).toEqual(expectedValue);
});

it('should prevent browser autofill on browser.refresh', function() {

loadFixture('back2dom');
expect(element(by.css('#input1')).getAttribute('value')).toEqual('');
expect(element(by.css('#input2')).getAttribute('value')).toEqual('');

element(by.css('textarea')).sendKeys('{{ internalFn() }}');

expect(element(by.css('#input1')).getAttribute('value')).toEqual('{{ internalFn() }}');
expect(element(by.css('#input2')).getAttribute('value')).toEqual('{{ internalFn() }}');
expect(element(by.css('body')).getAttribute('class')).toBe('');

browser.refresh();
expect(element(by.css('body')).getAttribute('class')).toBe('');
});

it('should prevent browser autofill on location.reload', function() {

loadFixture('back2dom');
expect(element(by.css('#input1')).getAttribute('value')).toEqual('');
expect(element(by.css('#input2')).getAttribute('value')).toEqual('');

element(by.css('textarea')).sendKeys('{{ internalFn() }}');

expect(element(by.css('#input1')).getAttribute('value')).toEqual('{{ internalFn() }}');
expect(element(by.css('#input2')).getAttribute('value')).toEqual('{{ internalFn() }}');
expect(element(by.css('body')).getAttribute('class')).toBe('');

browser.driver.executeScript('location.reload()');
expect(element(by.css('body')).getAttribute('class')).toBe('');
});

it('should prevent browser autofill on history.back', function() {

loadFixture('back2dom');
expect(element(by.css('#input1')).getAttribute('value')).toEqual('');
expect(element(by.css('#input2')).getAttribute('value')).toEqual('');

element(by.css('textarea')).sendKeys('{{ internalFn() }}');

expect(element(by.css('#input1')).getAttribute('value')).toEqual('{{ internalFn() }}');
expect(element(by.css('#input2')).getAttribute('value')).toEqual('{{ internalFn() }}');
expect(element(by.css('body')).getAttribute('class')).toBe('');

loadFixture('sample');

browser.driver.executeScript('history.back()');
expect(element(by.css('body')).getAttribute('class')).toBe('');
});

it('should prevent browser autofill on history.forward', function() {

loadFixture('sample');
loadFixture('back2dom');
expect(element(by.css('#input1')).getAttribute('value')).toEqual('');
expect(element(by.css('#input2')).getAttribute('value')).toEqual('');

element(by.css('textarea')).sendKeys('{{ internalFn() }}');

expect(element(by.css('#input1')).getAttribute('value')).toEqual('{{ internalFn() }}');
expect(element(by.css('#input2')).getAttribute('value')).toEqual('{{ internalFn() }}');
expect(element(by.css('body')).getAttribute('class')).toBe('');

browser.driver.executeScript('history.back()');
browser.driver.executeScript('history.forward()');
expect(element(by.css('body')).getAttribute('class')).toBe('');
});
});
Loading