File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 2929 * We try to be smart and only replace the constants when they are not within quotes.
3030 * Regular expressions being stateless, this is probably not 100% correct for edge cases.
3131 *
32- * @see https://regex101.com/r/9hXp5d/4/
32+ * @see https://regex101.com/r/9hXp5d/11
33+ * @see https://stackoverflow.com/a/171499/933065
3334 *
3435 * @var string
3536 */
36- const FILE_DIR_PATTERN = '/ (?>\' [^ \' ] *? \')|(?>"[^"] *?")|(?<file>\b__FILE__\b)|(?<dir>\b__DIR__\b)/m ' ;
37+ const FILE_DIR_PATTERN = '%(?>#.*?$)|(?>//.*?$)| (?>/\*.*?\*/)|(?> \' (?:(?=( \\\\ ?))\1.) *? \')|(?>"(?:(?=( \\\\ ?))\2.) *?")|(?<file>\b__FILE__\b)|(?<dir>\b__DIR__\b)%ms ' ;
3738
3839function inside_phar () {
3940 return 0 === strpos ( WP_CLI_ROOT , PHAR_STREAM_PREFIX );
You can’t perform that action at this time.
0 commit comments