Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
3 Apr 2014 at 04:39 UTC
Updated:
14 Jul 2014 at 22:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jdvc commentedComment #2
jdvc commentedComment #3
jdvc commentedComment #4
PA robot commentedWe 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 #5
thomas.fleming commentedOutside of what's mentioned in http://pareview.sh/, the code itself looks pretty solid. One thing I noticed on line 36 in field_wistia.admin.inc is that the value of @url has parentheses wrapped around it. Did you intend to wrap this value in url()?
You may go to http://pareview.sh/ and submit a review of your site using http://git.drupal.org/sandbox/joetoday/2191943.git.
Here are the main takeaways:
1) You will need to switch your module's default branch over to a non-master branch and remove master. Make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732 .
2) You will also need to set a param type in your documentation on line 73 of field_wistia.theme.inc. Param types are technically optional for D7 modules, but they are still required to pass this review. The param type in this case would likely be string.
Comment #6
thomas.fleming commentedComment #7
jdvc commentedThanks tidrif!
Yes, forgot to add url() and the actual URL in field_wistia.admin.inc. Thanks for catching it, now added.
1) Deleted the master branch, set default branch to 7.x-1.x.
2) Added param type in field_wistia_.theme.inc, line 73, and now no errors from pareview.
Comment #8
jdvc commentedComment #9
tonylegrone commentedHi joetoday,
First off, this module looks great!
I noticed that the permissions of all the module files except field_wistia.admin.inc are set at 755 (the default mode for folders). They should be set to 644 so that they don't have execute permissions.
You should also remove the trailing whitespace in the files as per https://drupal.org/coding-standards#indenting. Your editor should be able to do that automatically for you so you won't ever have to worry about it again. :)
I'm looking forward to seeing your module out in the wild!
Comment #10
jdvc commentedHey Tony,
Ok, set the correct permissions for the files and pushed.
However, could you specify which line number you see trailing whitespace on? The code is passing pareview with out any errors and that checks for whitespace, so I'm not sure what you are referring to?
http://pareview.sh/pareview/httpgitdrupalorgsandboxjoetoday2191943git
Thanks for reviewing!
joe
Comment #11
jdvc commentedComment #12
tonylegrone commentedThat's weird. I wonder if it ignores comments and multi-line strings.
Here's the list of places I found trailing spaces:
- field_wistia.admin.inc: 17
- field_wistia.info: 2, 5
- field_wistia.module: 90, 91
- field_wistia.theme.inc: 7
Comment #13
jdvc commentedYeah you are right, weird. A couple rouge spaces for sure. Well this forced me to get my sublime whitespace plugin working at least!
Just pushed the fix.
Thanks!
Comment #14
tonylegrone commentedAwesome! I love sublime. If you're having problems with that whitespace plugin, you might try adding
"trim_trailing_white_space_on_save": trueto your preferences.Everything looks good to me. Hopefully someone will promote it to a full project soon. Thanks for sharing your module!
Comment #15
jdvc commentedComment #16
jdvc commentedComment #17
jdvc commentedComment #18
mpdonadioAutomated Review
Review of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
Minor things, but fix when you can.
Manual Review
The duplication/collaboration issue is tricky with the video modules. There are two general purpose video modules that
I know about, Media and Video Embed Field. There are also some modules that provide fields for a particular
video provider. Media and Video Embed Field both provide hooks for adding different providers, which this module
does not implement. Long term, I would suggest adding support for these through submodules.
field_wistia_field_schema(). No primary key for your table? These are usally a good idea.
(+) Avoid building HTML in t(). In field_wistia_settings_form(), build the link with l(), and then pass this in
to t() as a placeholder.
(*) In field_wistia_field_widget_form(), pass in the ID as a parameter to t() (line 336). This is XSS vulnerable. If I schema
alter to make the field longer, I can set the URL to
http://www.wistia.com/medias/<script>alert('XSS')</script>and get the alert on the edit page. In addition, I would see if you can validate the ID, but validation is not a
substitute for output sanitization.
field_wistia_get_video_id() should probably return FALSE if the URL wasn't valid.
(+) field_wistia_get_remote_image() should use the File API for the thumbnail. See system_retrieve_file().
(+) It doesn't look like there is any cleanup of the thumnails when a video field is removed. This should be addressed.
(+) In theme_field_wistia_video(), don't build the URL manually, use url().
In _field_wistia_request_embed(), use drupal_json_decode().
The custom dimensions in the setting form can probably use some validation, and casting to int when you use them.
The starred (*) issues are blockers. Please don't remove the security tag, we keep that for statistics and to show examples of security problems.
The plussed (+) items are high priority, but not blockers.
Comment #19
jdvc commentedThanks for the review mpdonadio. Yes, I will integrate one of the general video modules in the future. When I originally though about using wistia, embedded media field wasn't yet available for Drupal 7. Also , I use wistia for a number of sites and this module does everything I need it to do with the lowest overhead. I think there are other people who use Wistia that will feel the same way.
Things I fixed:
pareview errors
FIXED
(+) Avoid building HTML in t(). In field_wistia_settings_form()
FIXED line 35 field_wistia.admin.inc
(*) In field_wistia_field_widget_form(), pass in the ID as a parameter to t() (line 336)
FIXED line 336 field_wistia.module
field_wistia_get_video_id() should probably return FALSE
FIXED line 35 field_wistia.inc
(+) field_wistia_get_remote_image() should use system_retrieve_file
FIXED line 82 field_wistia.inc
(+) In theme_field_wistia_video(), don't build the URL manually
FIXED line 54 field_wistia.theme.inc
_field_wistia_request_embed(), use drupal_json_decode()
FIXED line 84 field_wistia.theme.inc
On the immediate TODO list:
Thumbnail cleanup
Custom dimension validation
Comment #20
jdvc commentedComment #21
jdvc commentedComment #22
mpdonadioIgnore my comment in #18 about "Avoid building HTML in t(). In field_wistia_settings_form(), build the link with l(), and then pass this in to t() as a placeholder." I forgot this was the preferred practice so the link title gets translated.
Comment #23
jdvc commentedYes, adjusted accordingly to that one.
Comment #24
klausiLooks RTBC to me after a manual review! Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to heddn as he might have time to take a final look at this.
Comment #25
heddnComment #26
heddnManual Review
See
field_wistia_field_formatter_settings_summary&field_wistia_size_optionsThe manual review comments in the code walkthrough are recommendations.
Thanks for your contribution, Joe!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or 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. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #27
jdvc commentedAwesome, this is freaking cool! Thanks to everyone who helped review this!
Comment #28
tonylegrone commentedCongratulations Joe!