Commit graph

2852 commits

Author SHA1 Message Date
Lucas Galfasó
b3d7a038d7 fix(i18n): Do not transform arrays into objects
Do not trasnform arrays into objects when generating the locale objects
Add unit test for this check
2013-07-03 22:51:31 +01:00
Julien Bouquillon
ef5bc6c7c3 fix($sniffer): detect transition/animation on older Android browsers
The stock Android browser doesn't support the current for-in body/style
detection for animations and transitions but we can manually fix this.
This is useful for PhoneGap web-views or traditional web-apps using the
stock browser.
2013-07-03 22:16:31 +01:00
Sebastian Müller
22b9b47576 refactor(core): use native String.prototype.trim if available 2013-07-03 01:42:41 -07:00
Chirayu Krishnappa
5349b20097 fix($parse): disallow access to Function constructor
Enhances sandboxing of Angular Expressions to prevent attacks via:

  {}.toString.constructor(alert("evil JS code"))
2013-07-03 00:03:56 -07:00
Joao Sa
fd87eb0ca5 fix(jqLite): prepend array in correct order
Match jQuery behavior when prepending array into empty element
2013-07-02 23:24:51 -07:00
Vineet Kumar
3ffddad100 fix(ngCloak): hide element even when CSS 'display' is set
Previously an element like
<div class="foo ng-cloak">...</div>
would still be annoyingly visible if it matched a CSS rule like
.foo { display: inline-block; }, overriding ng-cloak's display: none.
2013-07-02 22:57:34 -07:00
exex zian
c21ab0a68a docs(tutorial/step9): formatted Unicode character line
Add tick and cross mark corresponding to their respective unicodes.
2013-07-02 22:49:54 -07:00
Ken Sheedlo
6957971405 fix(bower): Use latest ng-closure-runner 2013-07-02 22:36:22 -07:00
Igor Minar
69f42b7654 fix($compile): prevent infinite loop w/ replace+transclude directives
Previously if a template contained a directive that had a template
(sync or async) and the directive template was to replace the original
element and the directive template contained another directive on the
root element of this template and this new directive was an element
transclude directive then an infinite recursion would follow because
the compiler kept on re-adding and reapplying the original directive
to the replaced node.

This change fixes that.

Closes #2155
2013-07-02 22:35:39 -07:00
Igor Minar
cbbe3bfe91 revert: fix(compiler): corrects component transclusion on ...
This reverts commit 15e1a29cd0.

The original commit was fixing two issues - one of them was
preventing attributes that triggered directives that replaced
the compiled node to be merged into the new node.

This change was a breaking change (as seen in the diff of the
tests in this commit) and that's why it's being removed.

A proper fix will follow.
2013-07-02 22:35:39 -07:00
Pete Bacon Darwin
91e139e52a chore(grunt-utils): remove unnecessary quotes from minerr_url
The quotes were causing the minerr processing to fail on Windows
2013-07-02 22:35:06 +01:00
Vojta Jina
2c2adbcab5 chore(travis): speed up the build
- parallelize the tasks
- cache requests (e2e tests)

This reduces the time from ~18min to ~12min.

It makes the output little messy. We could buffer output of each task and display it once it's fully finished, nicely. I think giving instant feedback is better.
2013-07-02 13:58:52 -07:00
Pete Bacon Darwin
6e1b64176f chore(grunt-utils): fix java classpath on Windows 2013-07-02 20:58:37 +01:00
Igor Minar
726e0c246b test(ngRepeat): disable an element directive test on IE8 2013-07-02 11:11:52 -07:00
Igor Minar
c46c5924c4 revert: test(ngRepeat): fix IE8 test compatibility issue
This reverts commit 0c6fb665a4.

The change invalidated the test because the point of the the test
was to test that an element directive works. Changing it to attribute
directive was wrong.
2013-07-02 11:07:59 -07:00
Igor Minar
4f0f243771 fix($injector): refactor module loading code and use minErr 2013-07-02 11:05:30 -07:00
Niall Smart
48eb297c11 docs(guide/location): fix example code - hashPrefix is a method 2013-07-02 10:01:02 +01:00
Igor Minar
52c538c269 fix(jqLite): rename jqLiteError to jqLiteMinErr 2013-07-01 16:04:08 -07:00
Ken Sheedlo
c8fcf3b369 feat(minErr): Error stripping build step 2013-07-01 15:42:14 -07:00
Igor Minar
0c6fb665a4 test(ngRepeat): fix IE8 test compatibility issue 2013-07-01 14:30:43 -07:00
joshkurz
807394095b fix(Angular.js): handle duplicate params in parseKeyValue/toKeyValue
parseKeyValue and toKeyValue can now handle duplicate values in the query.
```
?x=1&x=2 <-> {x:[1,2]}
```

The algorithm looks like:
    1)parseKeyValue looks for presence of obj[key]
    2)detects and replaces obj[key] with [obj[key],val]
    3)then pushes more duplicates if necessary
    4)toKeyValue decodes array correctly
    5)(not changed)$location.search({param: 'key'}) still replaces if necessary
    6)(not changed)$location.search({param: ['key1', 'key2']}) sets the url with duplicates

BREAKING CHANGE: Before this change:
- `parseKeyValue` only took the last key overwriting all the previous keys;
- `toKeyValue` joined the keys together in a comma delimited string.
This was deemed buggy behavior. If your server relied on this behavior
then either the server should be fixed or a simple serialization of
the array should be done on the client before passing it to $location.
2013-07-01 19:32:12 +01:00
Vojta Jina
a258817310 chore: add karma-script-launcher plugin
This plugin is shipped as a default one with Karma. It's specified as a peer dependency.

I assume, there's an old version of NPM on the CI server, which does not support peerDependencies and therefore it didn't get installed.

This will make the dependency explicit.
2013-07-01 10:15:08 -07:00
Itamar Rogel
06a9972228 docs($cacheFactory): show that you can access existing caches 2013-07-01 12:01:07 +01:00
Spencer Applegate
1532ec1dfe docs(Angular.js): explain that toJson strips $... properties
In Angular.toJson, any properties with a leading '$' character will be
stripped from the resulting string since angular uses this notation
internally for services.  There have been complaints of not knowing
about this functionality until it breaks within their code.
2013-07-01 11:35:16 +01:00
Chirayu Krishnappa
a22596c925 test($compile): use FQDN for img[src]
img[src]="https://foo" has the unfortunate problem that the browser will
actually try retrieving the resource the non FQDN foo.  The local DNS
might suffix a domain to this, resolve it, and try to present a
certificate for the https request and prompt the user to pick a
certificate. This commit avoids that by making foo a FQDN.  Note that it
might be better to replace foo with example.com (ref
http://tools.ietf.org/html/rfc2606#section-3).
2013-06-28 17:38:11 -07:00
Chirayu Krishnappa
0e254cc88c chore(gitignore): add .agignore
I use a .agignore file to skip the build directory and some other files
while searching using Ag (see
https://github.com/ggreer/the_silver_searcher).
2013-06-28 13:04:31 -07:00
Vojta Jina
ac04b87851 test(docs): fix invalid paths 2013-06-28 11:43:38 -07:00
Vojta Jina
33223e26a0 chore: set up Sauce Labs with Travis
This should not affect the Jenkins build at all.

Now, the Travis build uses Chrome on Sauce Labs, which in theory gives us opportunity to use any
browser/platform that Sauce Labs offers.
2013-06-28 11:43:38 -07:00
Vojta Jina
976edc1fc4 chore: clean up angularFiles.js 2013-06-28 11:43:38 -07:00
Vojta Jina
29f96c852c chore: update karma to 0.9.4
And also add shared config to make karma configs a bit simpler.
2013-06-28 11:43:38 -07:00
Vojta Jina
89efb12ed8 chore: remove jstd leftovers 2013-06-28 11:43:38 -07:00
Igor Minar
b6b504b04c docs(misc/faq): remove obsolte t-shirt instructions 2013-06-28 11:27:32 -07:00
Igor Minar
e1ec5c7963 chore(build): change logging level for e2e tests to info 2013-06-28 09:33:08 -07:00
Pete Bacon Darwin
bd5c9a0371 style(ngRepeatSpec): fix up colons and iit 2013-06-28 08:28:06 +01:00
Igor Minar
15e1a29cd0 fix(compiler): corrects component transclusion on compilation root.
Closes# 2155
2013-06-27 21:30:24 -07:00
Igor Minar
344e195c60 chore(build): temporarily add more logging to debug flakiness on CI 2013-06-27 14:55:47 -07:00
Andrew Peterson
2adad3ab81 docs(ngBind): clarify some of the writing 2013-06-27 21:20:37 +01:00
Andrew Peterson
9d27b0af4c docs(ngPluralize): improve wording 2013-06-27 21:15:19 +01:00
Adam
bad9d1b71f docs(guide/e2e-testing): clarify description of input(name) selector
The description of the input selector made it seem that you were selecting
an input element based upon it's name attribute. In reality, you are
selecting an element by the string in the ng-model attribute.
2013-06-27 20:45:53 +01:00
Pete Bacon Darwin
fdab308278 docs(ngMock/$httpBackend): fix testing example
Closes #3075
2013-06-27 20:37:59 +01:00
Nelson Blaha
d57613cd6d docs(tutorial): add experiment showing reverse sort 2013-06-27 19:36:26 +01:00
Jeffrey Palmer
f810940600 docs(guide/controller): fix an error in the scope inheritance example
The chained scope creation example at the bottom of this document was using the childCtrl to create the babyScope, instead of the childScope.
2013-06-25 23:54:17 +01:00
Pete Bacon Darwin
73f8112032 fix(doc-gen): correctly transform index files
Closes #3021
2013-06-25 21:17:36 +01:00
Pete Bacon Darwin
71bc1b761d chore(doc_gen): add task to run doc-gen specs 2013-06-25 21:17:09 +01:00
Domenic Denicola
00d890c07a docs(guide/expression): remove reference to NullPointerException 2013-06-25 21:13:32 +01:00
Igor Minar
aef0980063 fix($location): default to / for the url base if no base[href]
With the recent refactoring of $location service we changed this behavior
resulting in a regression.

Previously we thought that html5 mode always required base[href]
to be set in order for urls to resolve properly. It turns out that
base[href] is problematic because it makes anchor urls (#foo) to
always resolve to the base url, which is almost always incorrect
and results in all anchors links and other anchor urls (e.g. svg
references) to be broken.

For this reason, we should now start recommending that people just
deploy to root context (/) and not set the base[href] when using
the html5 mode (push/pop history state).

If it's impossible to deploy to the root context then either all
urls in the app must be absolute or base[href] must be set with the
caveat that anchor urls in such app won't work.

Closes #2762
2013-06-24 22:32:55 -07:00
Chirayu Krishnappa
0960cd0613 test($compile): fix IE specific test. 2013-06-24 21:02:01 -07:00
Chirayu Krishnappa
cefdaf131d fix($parse): move global getter out of parse.js 2013-06-24 20:46:32 -07:00
Chirayu Krishnappa
38deedd6e3 fix($compile): reject multi-expression interpolations for src attribute
BREAKING CHANGE: Concatenating expressions makes it hard to reason about
    whether some combination of concatenated values are unsafe to use
    and could easily lead to XSS.  By requiring that a single expression
    be used for *[src/ng-src] such as iframe[src], object[src], etc.
    (but not img[src/ng-src] since that value is sanitized), we ensure that the value
    that's used is assigned or constructed by some JS code somewhere
    that is more testable or make it obvious that you bound the value to
    some user controlled value.  This helps reduce the load when
    auditing for XSS issues.

    To migrate your code, follow the example below:

        Before:
            JS:
                scope.baseUrl = 'page';
                scope.a = 1;
                scope.b = 2;
            HTML:
                <!-- Are a and b properly escaped here? Is baseUrl
                     controlled by user? -->
                <iframe src="{{baseUrl}}?a={{a}&b={{b}}">

        After:
            JS:
                var baseUrl = "page";
                scope.getIframeSrc = function() {
                  // There are obviously better ways to do this.  The
                  // key point is that one will think about this and do
                  // it the right way.
                  var qs = ["a", "b"].map(function(value, name) {
                      return encodeURIComponent(name) + "=" +
                             encodeURIComponent(value);
                    }).join("&");
                  // baseUrl isn't on scope so it isn't bound to a user
                  // controlled value.
                  return baseUrl + "?" + qs;
                }
            HTML: <iframe src="{{getIframeSrc()}}">
2013-06-24 14:17:18 -07:00
Chirayu Krishnappa
39841f2ec9 fix($compile): disallow interpolations for DOM event handlers
BREAKING CHANGE: Interpolations inside DOM event handlers are
    disallowed.  DOM event handlers execute arbitrary Javascript code.
    Using an interpolation for such handlers means that the interpolated
    value is a JS string that is evaluated.  Storing or generating such
    strings is error prone and likely leads to an XSS if you're not
    super careful.  On the other hand, ng-click and such event handlers
    evaluate Angular expressions that are a lot safer (e.g. No direct
    access to global objects - only scope), cleaner and harder to
    exploit.

    To migrate the code follow the example below:

    Before:

        JS:   scope.foo = 'alert(1)';
        HTML: <div onclick="{{foo}}">

    After:

        JS:   scope.foo = function() { alert(1); }
        HTML: <div ng-click="foo()">
2013-06-21 17:37:44 -07:00