Skip to content

Instantly share code, notes, and snippets.

@benhuson
Last active December 31, 2015 20:39
Show Gist options
  • Save benhuson/8041176 to your computer and use it in GitHub Desktop.
Save benhuson/8041176 to your computer and use it in GitHub Desktop.
Patch for Users 2 CSV WordPress plugin.
Index: users2csv.php
===================================================================
--- users2csv.php (revision 277117)
+++ users2csv.php (working copy)
@@ -26,7 +26,7 @@
if ( is_admin() ) {
- if ($_GET['page'] == "users2csv.php") {
+ if ( isset( $_GET['page'] ) && $_GET['page'] == 'users2csv.php' ) {
function _valToCsvHelper($val, $separator, $trimFunction) {
if ($trimFunction) $val = $trimFunction($val);
//If there is a separator (;) or a quote (") or a linebreak in the string, we need to quote it.
@@ -209,7 +209,7 @@
add_action('admin_menu','yoast_getcsv');
}
- if ( ! class_exists( 'Users2CSV' ) && !$_GET['csv'] == "true" ) {
+ if ( ! class_exists( 'Users2CSV' ) && ( ! isset( $_GET['csv'] ) || ! $_GET['csv'] == 'true' ) ) {
class Users2CSV {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment