Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Apr 2012 at 12:53 UTC
Updated:
29 Jul 2012 at 14:02 UTC
Creates an Issuu PHP Stream Wrapper for Resource and implements the various formatter and file listing hooks in the Media module.
Based on media_vimeo and media_youtube modules.
Uses Issuu search API
Which does not need an API-key from Issuu, which is required in development of 7.X version of Issuu module, which aims to allow uploading to issuu. This is read-only integration with thumbnail for the Media Internet Services module.
Sandbox page
Git repository
http://drupal.org/node/1592084#comment-6215954
http://drupal.org/node/1551090#comment-5933682
http://drupal.org/node/1549480#comment-5933742 (and follow up on comment #13)
Comments
Comment #1
patrickd commentedwelcome,
As installation and usage instructions are quite important for us to review, please take a moment to make your project page follow the tips for a great project page. Also make sure your README.txt follows the guidelines for in-project documentation.
Automated tools don't throw any errors, well done!
Please make sure your always using /**/ comments in global spec (outside of functions).
Please don't call drupal_get_path() so often, rather save it in a variable temporary.
Also you can replace this
include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'media_issuu') . '/includes/media_issuu.variables.inc';withinclude_once dirname(__FILE__) . '/includes/media_issuu.variables.inc';Remove your .gitignore from git (git rm .gitignore) and add it to itself.
We do really need more hands in the application queue and highly recommend to get a review bonus so we can come back to your application sooner.
regards
Comment #2
mallezieThanks for the review, i'll fix the proposed solution ASAP.
Setting to needs-work, since fixes from me are needed.
Comment #3
mallezieI fixed the errors you've noticed.
I only didn't replace the drupal_get_path() remark. I adjusted it to the form you suggested for the include statements. Otherwise there are only two get_path calls left.
Setting back to needs review. Now of to revieuw some others.
Comment #4
acobot commented1. Some errors from parview:
2. You should put the element of array in new line if the line is longer than 80 chars:
'description' => t('Issuu Styles will display embedded Issuu documents and thumbnails to your choosing, such as by resizing, setting colors. You can !manage.', array('!manage' => l(t('manage your Issuu styles here'), 'admin/config/media/media-issuu-styles'))),
3. Please follow the coding standards: http://drupal.org/node/318
Comment #5
mallezieFixed coding indention.
and note #2
Could you be more precise for note #3 since review tools give no other coding standard error.
Resetting to "needs review". Please don't set to needs work for only coding standard mistakes.
Comment #6
liam morlandThe Drupal Code Sniffer finds a bunch of issues. I suggest getting a clean report from that before requesting another review.
media_issuu_install() does nothing and be be left out.
In media_issuu_uninstall(), what is the purpose of the call to drupal_load()? It's already loaded if you are uninstalling it.
In media_issuu.module some comment lines begin and end with /* and */. Use a regular comment block for these.
Licensing: No problems noted.
Have you looked at the Issuu integration module? There may be some overlap. Your module could potentially depend on that one to reduce duplication.
Comment #7
mallezieThanks Lian for the review.
I fixed the coding style issues, seems they change sometimes, really thought it was a clean report.
Removed media_issuu_install()
Removed load from uninstall. Didn't have a purpose indeed.
Updated comment blocks.
I started at Issuu integration. See some comments in:
#1321774: [meta] Media integration
#1323164: Read-only integration with media
It seems development for the 7 version of issuu-integration stopped. I was only looking for read-only media-integration. So i decided to do in a sandbox. They also use the module to communicatie with the 'authentication needed' upload API of issuu, while i'm only using the public API, which doesn't need authorization keys. Adding issuu as a dependency whould create that overhead, which isn't needed.
This module only wants to be read only media-integration. Sort of like media_slideshare, media_youtube, media_vimeo, ...
Thanks for the review! Truly hope you could do another one.
Comment #8
mallezieAnd setting to needs review again
Comment #9
liam morlandLooks good. I haven't tested that it works, just that the code appears sound. I am presuming that you're making sure that the module works as it should.
Minor security issue in MediaIssuuStreamWrapper.inc:
getIssuuProperties() does not check that the value it returns is a string safe for including in a URL. It will be unless issuu.com is returning stuff that it shouldn't, but the getIssuuProperties() should check the value anyway, just to be sure. A simple regex check should be fine for this. Similar to the principle of not trusting user input, we shouldn't trust the values returned by outside services.
It's not a Drupal coding standard, but I prefer to use === instead of ==. If casting is needed, I would rather do the casting myself so that I know exactly what comparison is being made.
Comment #10
mallezieI updated code to use '==='.
I'm searching for a safe regex to use for the filename part. Using encode or drupal_encode_path replaces too much parts, such as - wich changes the returned value.
Thanks for the review!!
Comment #11
liam morlandYou can probably determine a regex for what a issuu documentId is supposed to contain.
Comment #12
mallezieAnd done.
Checks for documentID of 12 numbers a '-' and 32 hex digit.
Thanks again for te review and help!
Comment #12.0
mallezieAdded direct repository link
Comment #13
mallezieAdding review bonus.
Ddi three reviews over last months. Hope it wasn't necessary to do them in a shorter timeframe.
Comment #14
klausiModule duplication is a huge problem on drupal.org, and I really think this effort should go into the existing issuu module. Please get in contact with the maintainer to discuss, to get access to the repository and to develop from there. If you cannot reach the maintainer please follow the abandoned modules process: http://drupal.org/node/251466
If that does not work out for whatever reason and you absolutely must develop your own fork of issuu please come back here and set this application back to "needs review".
Comment #15
mallezieI'm further trying to contact the maintaner.
Comment #16
mallezieI'm closing this issue. Thanks for al the reviews. In the meantime i contacted the maintaner of drupal.org/project/issuu and i'm comaintaning that module for the media-integration.
Comment #17
patrickd commentedawesome! thank you!
Comment #17.0
patrickd commentedAdded reviews