Check JS sandbox project - https://www.drupal.org/sandbox/deepchandra84/2742711
GIT URL: http://git.drupal.org/sandbox/deepchandra84/2742711.git
Git clone command:
git clone --branch 7.x-1.x https://git.drupal.org/sandbox/deepchandra84/2742711.git check_js
cd check_js
Link to PAreview
http://pareview.sh/pareview/httpgitdrupalorgsandboxdeepchandra842742711git
All sites uses javascript a lot and lot's of feature depends on it but if browser doesn't support javascript or javascript is disabled in browser, then this module allows to display a user friendly disclaimer message to end user to enable the javascript in their browser. Disclaimer message is configurable in admin settings.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | javascript_disabled.png | 25.48 KB | deepchandra84 |
Comments
Comment #2
deepchandra84 commentedComment #3
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxdeepchandra842742711git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #4
ashwinshManual Review
Comment #5
deepchandra84 commentedComment #6
deepchandra84 commentedUpdated sandbox project page with GIT repository and other details.
Project Page
Check JS sandbox project - https://www.drupal.org/sandbox/deepchandra84/2742711
Git Repository
http://git.drupal.org/sandbox/deepchandra84/2742711.git
Comment #7
deepchandra84 commentedComment #8
gisleAdded Git clone command and link to PAreview to summary.
Comment #9
naveenvalecha@ashwin.shaharkar: look like you forgot to change the status. Is this now RTBC after your review or are there application blockers left and this should be "needs work"?
Comment #10
naveenvalechaComment #11
ashwinshComment #12
naveenvalecha@ashwin.shaharkar,
what are the blockers above , the review contains only preview template.
Comment #13
ashwinshHi @naveenvalecha,
I edited my comment, please ignore previous one. I see that now 'Git repository url and information regarding project' is added.
Thank you,
Comment #14
scott_euser commentedHi Deepchandra84,
Thanks for your contribution.
Generally the module looks good and is simple and efficient.
A few notes:
$page_topin the html.tpl.php rather than in the<head></head>. As the site administrator can potentially add html elements, it could result in invalid html markup pre-html5.hook_help(), should be "display" instead of "dispaly".What would be great to see (but not a requirement):
hook_js_alterif it fires early enough.Hope that helps!
Scott
Comment #15
scott_euser commentedComment #16
deepchandra84 commentedThanks @scott_euser for your review comments. It is really helpful to make it better.
I will make the changes and will commit the updated code.
Comment #17
deepchandra84 commentedCode has been updated as per comments from scott_euser.
Changing status to Needs Review.
Thanks,
Deep
Comment #18
scott_euser commentedThanks for that update. Could you please respond to the other 3 points if you don't intend to change.
Additionally, after further review, could you please use
check_plain()on plain text output orfilter_xss()for the html output. I realise the content is intended to be added by admins but since you register a permission it is possible that a not as trusted user could be granted permission to edit thecheck_js_message. Better to be safe to avoid any potential for XSS.Thanks!
Scott
Comment #19
deepchandra84 commentedHi scott_euser,
In my last commit, I have already updated the code with below 4 points:
$page_topin the html.tpl.php rather than in the<head></head>. As the site administrator can potentially add html elements, it could result in invalid html markup pre-html5. - DONEThanks
Comment #20
deepchandra84 commentedHello scott_euser,
I have added check_plain as suggested by you and committed the code.
Changing the status to needs review.
Thanks
Comment #21
scott_euser commentedHi Deepchandra84,
Are you sure you've pushed those commits? I see the
page_topand thecheck_plainnow but can still find 'dispaly' and 'All sites uses javascript' (although I wouldn't consider those critical of course).For
check_plain, that works when the text is plain text. You need to usefilter_xssif the editor selects a format other than plain text or any html markup would be escaped. If you can solve at least this one, I'm happy to move this into the final review steps.Thanks,
Scott
Comment #22
deepchandra84 commentedHello Scott_euser,
Yes, sorry, it's my bad. 'dispaly' and 'All sites uses javascript' code changes were missed in my last commit.
Now I have committed those changes along with filter_xss change.
Changing the status to needs review.
Thanks,
Deep
Comment #23
scott_euser commentedHi Deepchandra84,
Thanks for that. Looks pretty good. I see you're wanting to match the html tags based on the filter the visitor chooses / has access to. As the allowed html tags can be changed, hardcoding the list of allowed tags wouldn't work in all cases. Additionally, admins could create new text formats not in your list which would end up rendering as plain_text in your current setup.
Instead of your switch you can just do this:
$check_js_formatted_text = check_markup($check_js_content, $check_js_format);You can read more about that here (including a security warning) or view the full list of sanitising functions here.
Thanks,
Scott
Comment #24
scott_euser commentedComment #25
deepchandra84 commentedHello Scott,
Yes, I agree. Using check_markup is even better. I have updated the code with check_markup in place of switch case statement.
Thanks
Deep
Comment #26
scott_euser commentedGreat, looks good to me! Changing to reviewed and tested by the community, ready for final approval.
Comment #27
deepchandra84 commentedThanks a lot scott_euser for your review. It was really helpful and great learning :)
Comment #28
scott_euser commentedHappy to help, hope I was too nitpicky and annoying :)
Comment #29
mlncn commentedThanks for your contribution, deepchandra84! You are now a vetted Git user. You can promote this to a full project.
When you create new projects (typically as a sandbox to start) you can then promote them to a full project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process— in particular my long delay in approving after all reviews passed. We know it's broken and are trying to fix it.