Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Apr 2011 at 04:30 UTC
Updated:
11 Feb 2016 at 20:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
clemens.tolboomIncorrect usage of the t() function. The t() function expects English to translate into the target language.
Your project page is in Russian. You can google translate that in English
Please fix the reported issues. Don't forget to set status to needs review after committed to your sandbox project.
Powered by Dreditor (triage sandbox) and Triage transitions
Comment #2
innerfly commentedThank you for review.
I have fixed the usage of t() function and added description in English on the module page.
Comment #3
sreynen commentedTagging for easier finding.
Comment #4
innerfly commentedComment #5
tr commentedYour repository is structured wrong. You have branches named "6", "7", and "master". In Drupal, the branches must be named like 6.x-1.x, 7.x-1.x, not "6" and "7". See http://drupal.org/node/1015226
It's also recommended that your "master" branch be empty except for a README.txt explaining that the actual code is in 6.x-1.x or 7.x-1.x.
Comment #6
sreynen commentedIn addition to the branches having non-standard names, it looks like you have a non-standard file structure. Your .module file should be directly within the repository, not in a folder within the repository.
Comment #7
innerfly commentedthanx, branch names and structures corrected
Comment #8
klausithere is still a 7.x-1.x folder in the 7.x-1.x branch. This is not needed as said in #6. Same for 6.x.
Comment #9
innerfly commentedfixed
Comment #10
jthorson commentedt("Log responses in the !dblog", array('!dblog' => l(t('system log'), '/admin/reports/dblog')))drupal_set_message(t('Settings have been saved'), $type = 'status');on line 143$desc = t('Order №') . $order->order_id;on line 205.Also appear to have some non-printable characters on line 205:
$desc = t('Order â') . $order->order_id;$desc .= $value->qty . '× ' . $value->title;on line 201Comment #11
innerfly commentedThank you for very usefull comment.
1. I have not such release... What can I do in this case? Exclude image file?
2,3,4,5 Fixed
6. '№' сhanged to 'number'
7. If I will use '#type' => 'value' instead of 'hidden', this form fields will not be sent as POST request to payment system's server. Type 'hidden' is nessessary in this case as I think.
8. Fixed
Comment #12
jthorson commentedBulinat,
Thanks for the quick turnaround!
It appears that including the payment gateway logo is a common practice for commerce bridge modules ... I'll leave the decision up to you, as long as you're aware that we generally can not allow other copyrighted/trademarked material in contrib modules - anything in a contrib module is assumed to be licensed GPLv2, and I'm sure that companies generally don't consider their logos as 'free to use or modify'. ;)
My understanding was that '#type' => 'value' items would still be POSTed with the form, but would not be displayed on the screen. If you're posting the form directly, then maybe this isn't the case. Either way, it was only a suggestion, not a requirement for approval.
Marking RTBC, as the rest of the issues appear to have been addressed.
Comment #13
tim.plunkettReviewing the 7.x-1.x branch, there are chunks of code that are definitely written for D6.
hook_perm => hook_permission
Several doc blocks have "Implementation of hook_blah" where others have the correct "Implements hook_blah".
Comments should end with a full stop.
Comment #14
innerfly commentedusage of hook_permission() and comments corrected.
Comment #15
tr commentedRemove these lines from your .info file:
files[] is only for files that contain PHP classes.
Comment #16
innerfly commentedfixed
Comment #17
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Please report any bugs to klausi.
Comment #18
innerfly commentedIssues fixed
Comment #19
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Please report any bugs to klausi.
manual review:
'#suffix' => '<div class="description">' . t('For insertion into "Payment notification URL" field on <a target="_blank" href="!site">RBK Money</a> settings page', array('!site' => url('http://www.rbkmoney.ru'))) . '</div>',": you should create links with the l() function.$title = t('RBK Money') . '<br /><img src="' . $path . '/images/logo.gif" style="position: relative; left: 2.5em;">';": use theme('image', ...) to generate image markup.Comment #20
innerfly commentedthank you, issues fixed
Comment #21
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Please report any bugs to klausi.
manual review:
Comment #22
innerfly commentedthank you for review, all issues fixed.
Comment #23
innerfly commentedComment #24
klausiLooks good to me.
Comment #25
gregglesOn line 255 of the 6.x version I see that you are taking $_POST variables and logging them to watchdog. These variables may include malicious code including javascript.
You do an IP address check but it is possible to forge the server remote_addr variable and bypass that check.
I suggest two things:
1) Before doing a watchdog be sure to filter the variables.
2) You have a check for the hash later in the function - move that up to the top of the function and then watchdog and exit if the hash doesn't validate.
I didn't install the module and test this out, but can't someone just visit uc_rbkmoney/success and magically move their order into a complete state without actually paying any money?
Comment #26
dukem commentedI'm not sure that the uc_order_comment_save() function calls are correct at 6.x.
I haven't tried but as far as I remember after just visiting uc_rbkmoney/success the order will become 'pending', because there was no uc_payment_enter() call and balance isn't zero. But that still has to be reworked I think.
Comment #27
innerfly commentedto greggles:
1) fixed
2) I think that IP checking is not superfluous and it is necessary in current plase on top of function - this checking is recommended by payment system. Case when the hash doesn't validate located below in function.
About moving order into a complete state without paying a money. Change of the order's status occurs only when POST request from payment's system server is processed and hash checking was successfull. For calculation of hash it is used secret key as salt, which is known only to the owner of eshop, so it is not possible.
to dukem: Order's comments are stored properly.
You are right, after visiting uc_rbkmoney/success order status become 'pending'; uc_order_comment_save() called after POST request from payment system, if it containts successful status of the payment.
Comment #28
IRuslan commentedSome problems in 6.x version (may be 7.x has same problems):
You define permission
array('administer uc_rbkmoney');but it's never used.
Callbacks for uc_rbkmoney/success and uc_rbkmoney/fail use default 'access content' permission, but it's not flexible, better to use own permissions for that.
In uc_rbkmoney_setup() you wrote
t('Response URL: ') . $base_url . '/uc_rbkmoney/response'better is (and no need to define global $base_url...)
t('Response URL: !link', array('!link' => 'uc_rbkmoney/response'))In several lines you get key of $_SESSION array without isset() check, it may cause notices.
In uc_rbkmoney_done_payment() present hardcoded IP addresses, better make them configurable via variables_get(...)
Also, why you use $GLOBALS['_POST'] construction instead simple $_POST?
Available statuses from $response['paymentStatus'] should be defined via constants, it will improve readabilty and agilty of code.
Comment #29
IRuslan commentedComment #30
innerfly commentedThank you for response.
I have made permission 'administer uc_rbkmoney' for the path 'admin/store/settings/uc_rbkmoney'; paths 'uc_rbkmoney/response', 'uc_rbkmoney/success' and 'uc_rbkmoney/fail' must be accessible for all requests, so they have permissions 'access content'.
Define global $base_url in uc_rbkmoney_setup() is necessary because user need to see full path of the handler to copy/paste it at the payment system's setting page.
Isset() check for the $_SESSION added.
Added settings form for the allowed IP addresses instead hardcoded list.
$GLOBALS['_POST'] changed to $_POST.
Payment statuses defined via constants.
Comment #31
scarer commentedErrors through Ventral.
Lines too long in README.txt file. Split onto multiple lines (80 character limit).
uc.rbkmoney.info - Missing blank line at end of file.
uc_rbkmoney.install - Errors in function doc comment, missing punctuation makes for comment, whitespace at end of line, missing black line at end of file.
uc_rbkmoney.module - Blank line needed after file doc comment, lines exceeding 80 characters, translation problems (use t() for text arguments), comma missing for multiline array, spacing issues, inline comment capitalisation, use function ip_address() not $_SERVER, blank lines after break statements, missing blank line at end of file.
I find it helpful to use a text editor that can show you invisible characters (e.g. spaces).
Please find attached Ventral output.
Review bonus.
Comment #32
patrickd commented// edit
unrelated
Comment #33
innerfly commentedfixed
Comment #34
patrickd commentedYour project page is not very detailed, please have a look at the tips for a great project page, you may also use HTML-tags for better structure. Same with your readme, you may have a look at the common styles for readme's (see guidelines for in-project documentation.)
7.x-1.x
t('Response URL:') . ' ' . $base_url . '/uc_rbkmoney/response',why not usingt('Response URL: %url', array('%url' => $base_url . '/uc_rbkmoney/response')),t('Save RBK Money\'s server responses in !dblog')rather use "money's" instead of 'money\'s'$form['#prefix'] = '<table><tr><td>';rather use a proper<div>with some css here instead of using table's (using tables for formatting is not very professional these days)$base_url . '/uc_rbkmoney/success'please use url() here instead if possible.watchdog("uc_rbkmoney", "Possible fraud. Error with REMOTE IP ADDRESS = " . ip_address() . ". The remote address of the script posting to this notify script does not match a valid RBK Money ip address");Please use the variables parameter of watchdog() here for the ip_address to keep the message translatable- also, use the proper severity - if this is an error - mark it like an error
6.x-1.x
If possible, break lines after 80 characters because eg. line 287 is very hard to read, and about 500 characters long.
Beside this I can't find a critical issue, therefore RTBC for me
Comment #35
klausiReview 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. Get a review bonus and we will come back to your application sooner.
manual review:
Although you should definitively fix those issues they are not application blockers, so ...
Thanks for your contribution! Welcome to the community of project contributors on drupal.org.
I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.
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.
As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.
Thanks to the dedicated reviewer(s) as well.