[
https://issues.apache.org/jira/browse/CB-13496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16605339#comment-16605339
]
ASF GitHub Bot commented on CB-13496:
-------------------------------------
dpogue opened a new pull request #45: CB-13496: Fix greedy regex in
plist-helpers
URL: https://github.com/apache/cordova-common/pull/45
<!--
Please make sure the checklist boxes are all checked before submitting the
PR. The checklist
is intended as a quick reference, for complete details please see our
Contributor Guidelines:
http://cordova.apache.org/contribute/contribute_guidelines.html
Thanks!
-->
### Platforms affected
iOS
### What does this PR do?
Resolves an issue where a regex was overly greedy when comparing plist
entries for merging and could result in collapsing several of them into a
single entry.
### What testing has been done on this change?
Added a test that fails with current master and passes with this change,
based on the details provided by @knight9999 in the JIRA bug. It sounds like
this might be the cause of GH-44 as well (/fyi @donnie-jp).
Now, my fix assumes that we're always looking for `$(something)` and not
just `$something`, which *might* not be a safe assumption. Unfortunately I'm
not well-versed enough in iOS stuff to know :(
### Checklist
- [x] Reported an issue in the JIRA database
- [x] Commit message follows the format
- [x] Added automated test coverage as appropriate for this change.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> the plugin config-file tag for iOS plist array behaves unnaturally.
> -------------------------------------------------------------------
>
> Key: CB-13496
> URL: https://issues.apache.org/jira/browse/CB-13496
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-common
> Affects Versions: 2.1.0
> Environment: Mac OSX
> Reporter: Ken Naito
> Priority: Trivial
> Original Estimate: 504h
> Remaining Estimate: 504h
>
> In the src/util/plist-helpers.js, in the nodeEqual function,
> ```
> node2 = escapeRE(node2).replace(/\\\$\S+/gm, '(.*?)');
> ```
> seems the strange behavior.
> For example, the escaped node2 "$(ABC)Hello" becomes "(.*?)".
> In the previous version of this code is
> ```
> node2 = escapeRE(node2).replace(new RegExp('\\$[a-zA-Z0-9-_]+','gm'),'(.*?)');
> ```
> in this case, the escaped node2 "$(ABC)Hello" is unchaned.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]