# HG changeset patch # User Dan # Date 1259684145 18000 # Node ID 21ef2f8feb59a24822103e0223b4b8fa43ee7806 # Parent fcb2be1428e76115f0b1f455c7652e2517731119 Plugin block parser: Fixed plugin block parsing for plugin files in CRLF format diff -r fcb2be1428e7 -r 21ef2f8feb59 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';