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

Handle Encoding or Opposite Slash in Feature Paths #362

Merged
merged 1 commit into from
Aug 16, 2016
Merged
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
5 changes: 5 additions & 0 deletions src/Pickles/Pickles.BaseDhtmlFiles/js/featureSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

var queryVars = query.split('&');

// find feature query param
for (var i=0;i<queryVars.length;i++) {
var pair = queryVars[i].split('=');
if (pair[0] == 'feature') {
Expand Down Expand Up @@ -84,6 +85,10 @@ function getFeaturesMatching(searchString, features) {
}

function findFeatureByRelativeFolder(path, features) {
// make sure path is not url encoded, and replace forward-slashes with back-slashes to match JSON
path = decodeURIComponent(path);
path = path.replace(/\//g, '\\');

var feature = _.find(features, function(featureTesting) {
return featureTesting.RelativeFolder == path;
});
Expand Down