Skip to content
This repository
Browse code

FIX Config frag could only have one before or after rule

You should be able to specify multiple before and after rules in
a config fragment. This was intended to be a comma seperated string
but that wasnt being split properly

Now if you provide a comma seperated string it is split properly,
but you can also provide an array, which is actually cleaner
  • Loading branch information...
commit c7ca47f2b11c39cbb8ca2e34ecc57bd2cc936bce 1 parent 0aa2894
Hamish Friedlander authored August 27, 2012

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  core/manifest/ConfigManifest.php
3  core/manifest/ConfigManifest.php
@@ -217,7 +217,8 @@ public function addYAMLConfigFile($basename, $pathname, $depth) {
217 217
 				foreach (array('before', 'after') as $order) {
218 218
 					if (isset($header[$order])) {
219 219
 						// First, splice into parts (multiple before or after parts are allowed, comma separated)
220  
-						$orderparts = preg_split('/\s+,\s+/', $header[$order], PREG_SPLIT_NO_EMPTY);
  220
+						if (is_array($header[$order])) $orderparts = $header[$order];
  221
+						else $orderparts = preg_split('/\s*,\s*/', $header[$order], -1, PREG_SPLIT_NO_EMPTY);
221 222
 
222 223
 						// For each, parse out into module/file#name, and set any missing to "*"
223 224
 						$header[$order] = array();

0 notes on commit c7ca47f

Please sign in to comment.
Something went wrong with that request. Please try again.