Plugin block parser: Fixed plugin block parsing for plugin files in CRLF format
authorDan
Tue, 01 Dec 2009 11:15:45 -0500
changeset 1145 21ef2f8feb59
parent 1144 fcb2be1428e7
child 1146 4a90e6e46937
Plugin block parser: Fixed plugin block parsing for plugin files in CRLF format
includes/plugins.php
--- a/includes/plugins.php	Tue Dec 01 00:35:04 2009 -0500
+++ b/includes/plugins.php	Tue Dec 01 11:15:45 2009 -0500
@@ -188,10 +188,14 @@
       return array();
     }
     
+    // The "\r?" in this regular expression is the result of an embarrassing failure during a job related meeting.
+    // I was demoing the authoring of an Enano plugin and simply could not figure out why the plugin would not
+    // show up in the admin panel.
+
     $regexp = '#^/\*\*!([a-z0-9_]+)'  // block header and type
             . '(([\s]+[a-z0-9_]+[\s]*=[\s]*".+?"[\s]*;)*)' // parameters
-            . '[\s]*\*\*' . "\n"      // spacing and header close
-            . '([\w\W]+?)' . "\n"     // value
+            . '[\s]*\*\*' . "\r?\n"      // spacing and header close
+            . '([\w\W]+?)' . "\r?\n"     // value
             . '\*\*!\*/'              // closing comment
             . '#m';