AngularJs: Error: A security problem occurred in IE11 - angularjs

We have developed a site using AngularJS 1.2.x version. The data to be displayed is got as a JSON and we have used angular expresions to populate these.
In the JSON response we have a URL in this format http://username#site.com. This is getting rendered properly in Chrome, FF. But in IE11 we are getting the following exception
Error: A security problem occurred.
at xa (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:124:230)
at Anonymous function (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:116:319)
at Anonymous function (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:116:319)
at Anonymous function (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:116:319)
at r (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:7:390)
at start (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:285:470)
at c (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:282:408)
at G (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:284:243)
at Anonymous
We found a similar question in(Angularjs with Internet Explorer 11, security issue) but the link provided in the accepted answer is no longer valid.
Is there any workaround to solve this issue?

I guess it's not possible, it's a security matter of IE and there's no workaround for that other than changing the url format to something IE accepts.
About the broken link, for some reason the english version of that article is not available anymore, but I've switched the locales in the url and managed to find other languages including pt-BR, pt-PT, es-ES and based on your profile hi-IN, if that doesn't work for you, you can try to Google Translate one of them to english or even try different lacale in the article url.
Those are the ones I tried and they're not broken:
Portuguese (Portugal) : pt-PT - https://support.microsoft.com/pt-pt/help/834489
Chinese (China) : zh-cn - https://support.microsoft.com/zh-cn/help/834489
Portuguese (Brazil): pt-BR - https://support.microsoft.com/pt-br/help/834489
Spanish (Spain): es-ES - https://support.microsoft.com/es-es/help/834489
Hindi (India): hi-IN - https://support.microsoft.com/hi-in/help/834489
Japanese (Japan): ja-jp - https://support.microsoft.com/ja-jp/help/834489
There ought to have more locales available but I'm not wiling to test all of them.

Related

"angular.bootstrap()" throws error when Angular version is updated

Not sure if this is the appropriate place for this question, but when I simply updated my Angular script from 1.4.8 to 1.5.11, the UI bombs out and throws an error when attempting to do an angular.bootstrap(...):
https://code.angularjs.org/1.5.11/docs/error/$injector/modulerr?p0=ckwy4037000003e8twhn1wp0a&p1=Error: [$injector:modulerr] http://errors.angularjs.org/1.5.11/$injector/modulerr?p0=sn.common.attachments&p1=Error: [$injector:nomod] http://errors.angularjs.org/1.5.11/$injector/nomod?p0=sn.common.attachments
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:9:426
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:28:235
at b (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:27:282)
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:28:20
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:43:17
at q (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:10:371)
at g (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:42:382)
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:43:34
at q (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:10:371)
at g (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:42:382)
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:9:426
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:43:292
at q (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:10:371)
at g (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:42:382)
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:43:34
at q (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:10:371)
at g (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:42:382)
at fb (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:46:381)
at c (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:24:19)
at Object.Gc [as bootstrap] (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:24:332
...wondering if anyone else has come across this issue, and if they have an idea of what's going on?
I'm not really familiar with Angular, but from looking at the docs, when I compare between v1.4.8 and v1.5.11, the only difference I see is the two yellow banners - one in particular that says:
Note: Do not bootstrap the app on an element with a directive that
uses transclusion, such as ngIf, ngInclude and ngView. Doing this
misplaces the app $rootElement and the app's injector, causing
animations to stop working and making the injector inaccessible from
outside the app.
This looks related, but I'm not 100% certain that that may be...
Fixed in the comments:
Are you still providing sn.common.attachments, per your error URL?
you were right! It was a bad path (changed the version number in the path, but that path doesn't exist for that version)... Thank you!!!!
Angular employs a technique where its error messages are encoded as URLs, which enables more-informative and translatable error messages without bloating the production app size. Consequently, that first https://code.angularjs.org/ URL actually contains the real $injector:nomod error that the URL target describes. From there it's easier to see that the bootstrap failed due to the absence of a module, here sn.common.attachments specifically.

max-pool-size is invalid in combination with derive-size

For the last couple of days I’ve been battling with an issue which I believe is derived from a change in the source code in Thorntail and unfortunately this code doesn’t appear to be publically available.
The error I’ve been receiving is this:
"WFLYCTL0105: max-pool-size is invalid in combination with derive-size".
Previously you could just leave a “derive-size” out of the configuration and there wasn’t an issue however now anytime I’ve included the “max-pool-size” no matter what the combination with “derive-size” it fails with the above mentioned error.
From the latest Thorntail dococumentation:
Specifies if and what the max pool size should be derived from. An
undefined value (or the deprecated value 'none' which is converted to
undefined) indicates that the explicit value of max-pool-size should
be used.
This is what I had previously in WildFly project-defaults.yml which worked perfectly fine:
ejb3:
default-resource-adapter-name: activemq-rar.rar
default-mdb-instance-pool: mdb-strict-max-pool
strict-max-bean-instance-pools:
mdb-strict-max-pool:
max-pool-size: 1
Any ideas or examples would be greatly appreciated.
More information added in response to questions:
The project was updated from using WildFly Swarm 2018.4.1 to use Thorntail 2.2.0.Final.
The code that appears to have changed in Thorntail is below:
OLD code:
https://github.com/stuartwdouglas/wildfly-swarm-core/blob/master/ejb/api/src/main/java/org/wildfly/swarm/ejb/EJBFraction.java
.strictMaxBeanInstancePool(new StrictMaxBeanInstancePool("mdb-strict-max-pool").maxPoolSize(20).timeout(5L).timeoutUnit(StrictMaxBeanInstancePool.TimeoutUnit.MINUTES))
New Code:
https://github.com/thorntail/thorntail/blob/802e785fdd515ecc1b52b22a64a6ff9338dace29/fractions/javaee/ejb/src/main/java/org/wildfly/swarm/ejb/EJBFraction.java
.strictMaxBeanInstancePool(new StrictMaxBeanInstancePool("mdb-strict-max-pool").deriveSize(StrictMaxBeanInstancePool.DeriveSize.FROM_CPU_COUNT).timeout(5L).timeoutUnit(StrictMaxBeanInstancePool.TimeoutUnit.MINUTES))
If anyone has a link to the above source code that would be great. The only links I can find appear to be from JBOSS so the code looks like it was ported accross and not made publicly avaiable.
After the question update: the default configuration of a couple of fractions was changed to better align with default configuration in WildFly 11. You can configure derive-size: null and then the max-pool-size should take effect.
Something like:
ejb3:
default-resource-adapter-name: activemq-rar.rar
default-mdb-instance-pool: mdb-strict-max-pool
strict-max-bean-instance-pools:
mdb-strict-max-pool:
derive-size: null
max-pool-size: 1
(Note: previously, this answer recommended setting derive-size: none, but that doesn't work. After the discussion in comments, I changed the answer to recommend derive-size: null, which does work.)

templatetags and context['request']

So i'm learning Wagtail and trying to understand how to generate menus. So far i've found the bakerydemo repo helpful. One major point of confusion for me is understanding how to use the templatetags used for menus in the bakery demo. Below is the code for the get_site_root tag (django docs recommend that as of 1.11 that simple_tag will also work and so I changed it to that.)
#register.assignment_tag(takes_context=True)
def get_site_root(context):
# This returns a core.Page. The main menu needs to have
# the site.root_page
#defined else will return an object attribute error ('str' object
#has no attribute 'get_children')
return context['request'].site.root_page
No matter what I do I can't seem to get this to work. Either nothing is returned or I get various errors like the request key isn't in context or others. I looked at the Site middleware then traced that to the site model staticmethod "find_for_request" which in turn should be calling "get_site_for_hostname" in the sites.py . Anyways, I would love some guidance on what I am doing wrong or misunderstanding. Also, any help in understading the "wagtailthonic" way of generating menus from page hierarchies would be welcome.
Here is an image of the page and site tables.

Ext Post converts characters in IE11

I noticed that in IE11 and Edge (but not Chrome), Extjs6 is encoding my jsonData in a strange way. If I do a POST with the string '‎8‎/‎17‎/‎2016 13:07:00' as one of the jsonData parameters, it will pass '\u200e8\u200e/\u200e17\u200e/\u200e2016 13:07:00' in the request body.
I also noticed that if I enter Ext.JSON.encode('‎8‎/‎17‎/‎2016 13:07:00') into the console that it converts the string in the same way. I suspect that Extjs is using IE's encoder (since Chrome works), so it is really an IE issue and not an Extjs issue. Can you please explain why this happens and if there is a format that will not convert improperly for my POST?
There is a simple mistake here as far as i think.
Do
Ext.JSON.encode("8/17/2016 13:07:00")
instead of
Ext.JSON.encode('8/17/2016 13:07:00')
then it will take it as the string that you want.
And ya one more thing, this issue will be in latest chrome version also.
Once I discovered the issue is with toLocaleDateString(), then I found this post which answered the question:
ToLocaleDateString() changes in IE11
Instead of Ext.encode(new Date('2016-08-17T06:37:00').toLocaleDateString()), use Ext.encode(new Date('2016-08-17T06:37:00').toLocaleDateString().replace(/\u200E/g, ''))

Sitecore country ISO in url

I have created a site with multiple languages in sitecore... I the content editor (system > languages) I have specified three languages (Dutch, English and German). No I have 2 problems.
When an item has, for example: an English version but no German and Dutch version and I type the address to the German site: www.testsite.com/de I get the German site, but without content. In this case I want a 404 page to be shown.
Another problem is when I go to language that is not specified in system > language and also on the item is still get an empty site. In this case I also want a 404 page to be shown. Sitecore shows the page as long as it is a valid ISO-code.
I'm using Sitecore 6.4
Does anybody has a solution for these problem(s)?
Thanks in advance!
mrtentje
My LinkManager is specified as follows in the Web.config:
<add name="sitecore" type="Sitecore.Links.LinkProvider, Sitecore.Kernel" addAspxExtension="true" alwaysIncludeServerUrl="false" encodeNames="true" languageEmbedding="asNeeded" languageLocation="filePath" shortenUrls="true" useDisplayName="false"/>
Unfortunately you have to manage both of these scenarios manually in Sitecore, they both have quite simple solutions but will require some development on your part.
For the first (accessing of pages without translations) I think you would need to extend the current ItemResolver within Sitecore and have it explicitly check that a version exists for the language that has been selected. I haven't implemented that myself but that's how I'd look at handling it.
The second (only accepting certain languages) is something I have handled, and it really bothered me that Sitecore couldn't handle it itself (though perhaps it does and I missed it). For this I created a step in the pipeline immediately after the LanguageResolver called PermissableLanguageChecker. This checks to see if the current language of the request is one of certain allowable values, and if it isn't it sets the language back to the default language, or in your case throw a 404.
For the "allowable values", I read them from the site config with a new property there:
<site name="website" ... permissableLanguages="pl-PL,en" language="pl-PL" ... />
That permissableLanguages property is handy as we can also use it later on in the site when presenting a language selection control to the user.
You may want to take a look at the Language Fallback module in the Sitecore Shared Source Library. As it covers some of your scenarios.
http://trac.sitecore.net/LanguageFallback

Resources