Guest User

patch to fix XSS in Google Analytics Multisite Async

a guest
Jul 28th, 2011
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. --- ../ga-mu-async.php 2011-05-17 18:07:00.000000000 -0400
  2. +++ ga-mu-async.php 2011-07-28 10:07:18.009911000 -0400
  3. @@ -65,7 +65,7 @@
  4. }
  5.  
  6. if (isset($_POST['UAID'])) {
  7. - update_option(UAID_OPTION, $_POST['UAID']);
  8. + update_option(UAID_OPTION, preg_replace('/[^a-zA-Z\d\-]/','',$_POST['UAID']));
  9. ?>
  10. <div id="message" class="updated fade"><p><?php _e('Analytics ID saved.', 'ga-mu-async') ?></p></div>
  11. <?php } ?>
  12. @@ -121,9 +121,9 @@
  13. $allowSiteSpecificAccounts = 0;
  14. }
  15. switch_to_blog(MAIN_BLOG_ID);
  16. - update_option(UAID_OPTION, $_POST['UAIDsuper']);
  17. - update_option(MAINDOMAIN_OPTION, $_POST['MainDomain']);
  18. - update_option(SITE_SPECIFIC_ALLOWED_OPTION, $_POST['AllowSiteSpecificAccounts']);
  19. + update_option(UAID_OPTION, preg_replace('/[^a-zA-Z\d\-]/','',$_POST['UAIDsuper']));
  20. + update_option(MAINDOMAIN_OPTION, preg_replace('/[^a-zA-Z\d\-\.]/','',$_POST['MainDomain']));
  21. + update_option(SITE_SPECIFIC_ALLOWED_OPTION, preg_replace('/[^a-zA-Z\d\-]/','',$_POST['AllowSiteSpecificAccounts']));
  22. restore_current_blog();
  23. ?>
  24. <div id="message" class="updated fade"><p><?php _e('Network settings saved.', 'ga-mu-async') ?></p></div>
  25. @@ -254,4 +254,4 @@
  26. }
  27. }
  28. endif;
  29. -?>
  30. \ No newline at end of file
  31. +?>
Add Comment
Please, Sign In to add comment