Description
This module allows user-defined user-agents to bypass Drupal Core's page cache. Additionally, when the page cache is bypassed, the existing page cache entry for the page is updated with the latest rendering. See the project page for some sample use-cases.
Project Page
http://drupal.org/sandbox/iamEAP/1418344
Repository
git clone --branch 6.x-1.x http://git.drupal.org/sandbox/iamEAP/1418344.git
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/iamEAP/1418344.git
Versions
Drupal 6.x, 7.x
Background
I've been working with Drupal in site building, theming, and development contexts for nearly three years and have been using PHP and MySQL for work and play back five years prior. I hold bachelor's degrees in Computer Science and Digital Media studies from the University of Denver. I currently work fulltime as a developer on a Drupal website for a software company in Seattle.
I've previously submitted a module to this application queue, but the process took so long that someone else implemented another version of the same thing. I'm an active co-maintainer of the new one now, but hopefully this application goes by faster.
Comments
Comment #1
eugene.ilyin commentedHello. I spent a Review of your module.
variable_get('ua_cache_bypass_crawler_names'... this is user provided text, I think you need to sanitize it to avoid XSS attacks.
switch ($path) {
case 'admin/help#ua_cache_bypass':
return filter_filter('process', 1, NULL, file_get_contents(dirname(__FILE__) . "/README.txt"));
}
I think IF operator is better for this.
Comment #2
iamEAP commentedua_cache_bypass_crawler_names is never displayed anywhere, so there's no need to filter it for XSS vulnerabilities. It's only used within hook_boot() to test against the user agent string.
Comment #3
eugene.ilyin commentedOkay.
Sorry I missed string
in my previous comment.
Comment #4
iamEAP commentedThanks for the clarification.
In this case, that may be true, given that I'm unlikely to implement other help pages, but this is how core handles help pages and how I've seen it in all of the code examples, so I decided to go with what's standard. See: http://api.drupal.org/api/drupal/developer%21hooks%21core.php/function/h...
Thanks for the reviews.
Comment #5
Robertas commentedReview of the 6.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.
Source: http://ventral.org/pareview - PAReview.sh online service
Comment #6
klausiNo manual review given, and the minor coding style issues do not justify the "needs work" status.
The response time for a review is now approaching 4 weeks. Get a review bonus and we will come back to your application sooner.
Comment #7
iamEAP commentedTook care of those style issues because I might as well.
For whomever reviews this next, I was informed by another module developer that the "Implements hook_foo()." style is a Drupal 7 specific style and that the Drupal 6 standard is "Implementation of hook_foo()."
Comment #8
klausiAs your module represents new code it should go with the most recent version of coding standards where possible. From http://drupal.org/coding-standards :
Comment #9
Robertas commentedIn ua_cache_bypass.module:102
your code:
watchdog('cache bypass', 'Page cache was bypassed via user-agent string: !ua', array('!ua' => $_SERVER['HTTP_USER_AGENT']), WATCHDOG_NOTICE);Superglobal variables, like $_SERVER['HTTP_USER_AGENT'] can be spoofed and used for XSS attack. It needs to be filtered before being inserted into log by watchdog(). Therefore you should use %ua rather than !ua.
Comment #10
iamEAP commentedGreat catch, Robertas. Change made. Thanks for the review!
Comment #11
jrockowitz commentedIn hook_menu() you can remove the ua_cache_bypass_config_page() menu callback and use drupal_get_form().
Instead of
You can just use 'drupal_get_form' as the 'page callback' and array('ua_cache_bypass_settings') as the 'page arguments'.
BTW, this is a very minor tweak. I have also tested that the code is working as expected using Firefox's User Agent Switcher.
Comment #12
iamEAP commentedMay as well scrub that extra function call out. Change committed; thanks, Jake.
Comment #13
iamEAP commentedOver a month at needs review; marking critical as per workflow rules.
Comment #14
klausiSorry for the delay, but you have not listed any reviews of other project applications in your issue summary as strongly recommended in the application documentation.
manual review:
But that are just minor issues, otherwise this looks RTBC to me. Assigning to tim.plunkett as he might have time to finally approve this.
Comment #15
michelleI granted access based on klausi's RTBC. I think that's all that needs to be done? If not, let me know.
Comment #16
klausiThanks for your contribution, iamEAP! Welcome to the community of project contributors on drupal.org.
Michelle has 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.
Comment #17
iamEAP commentedAwesome! Thanks for the reviews and advice, everyone.
Comment #18.0
(not verified) commentedAdding support for Drupal 7.x.