Not only useful in programming, regular expressions can make complex tasks easy in many different scenarios. Here is a great site for testing your regex:
http://rubular.com
EDIT: removed the first patch b/c it wasn't completely correct. Below is the complete patch that should be applied. | |
diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php | |
index 5bc475d..5b5e693 100644 | |
--- a/wp-includes/plugin.php | |
+++ b/wp-includes/plugin.php | |
@@ -568,10 +568,12 @@ function plugin_basename($file) { | |
$mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash |
diff --git a/wp-content/plugins/contact-form-7/wp-contact-form-7.php b/wp-content/plugins/contact-form-7/wp-contact-form-7.php | |
index ea9427f..b8549e2 100644 | |
--- a/wp-content/plugins/contact-form-7/wp-contact-form-7.php | |
+++ b/wp-content/plugins/contact-form-7/wp-contact-form-7.php | |
@@ -30,8 +30,9 @@ define( 'WPCF7_VERSION', '2.4.6' ); | |
if ( ! defined( 'WPCF7_PLUGIN_BASENAME' ) ) | |
define( 'WPCF7_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); | |
-if ( ! defined( 'WPCF7_PLUGIN_NAME' ) ) | |
- define( 'WPCF7_PLUGIN_NAME', trim( dirname( WPCF7_PLUGIN_BASENAME ), '/' ) ); |
error_reporting(E_ALL); | |
ini_set('display_errors', TRUE); | |
ini_set('display_startup_errors', TRUE); |
# == IGNORE LOCAL CHANGES | |
# ignore local changes to repository files or directories | |
git update-index --assume-unchanged path/to/file/or/directory | |
# -- ALIAS | |
# or you can alias it in your ~/.gitconfig | |
[alias] | |
au = update-index --assume-unchanged | |
# == UN-IGNORE LOCAL CHANGES |