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

Fix forum title encoding re auto support topic creation link (#2150) #2269

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
10 changes: 10 additions & 0 deletions src/rockstor/storageadmin/static/storageadmin/js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,15 @@ Handlebars.registerHelper('sidenav', function(condition) {
}
return new Handlebars.SafeString(html);
});

// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
// attempt to conform to https://tools.ietf.org/html/rfc3986
Handlebars.registerHelper('clean_forum_title', function(err_detail) {
return encodeURIComponent(err_detail).replace(/[!'()*]/g, function(c) {
return '%' + c.charCodeAt(0).toString(16);
});
});

//Initiate the router
var app_router = new AppRouter;
//###Render the view###
Expand Down Expand Up @@ -1199,4 +1208,5 @@ $(document).ready(function() {
return new Handlebars.SafeString(html);
});


});
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
</a>
to copy the above traceback to your clipboard.
</li>
<li>Create a support topic with information from above two steps <a href="https://forum.rockstor.com/new-topic?title={{detail}}&category=support" target="_blank">here</a>.</li>
<li>Create a support topic from the above two steps <a
href="https://forum.rockstor.com/new-topic?title={{clean_forum_title detail}}&category=support" target="_blank">here</a>.</li>
</ol>
</div> <!-- err-help -->
{{/unless}}