aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2017-07-16 11:17:36 +0200
committerMarc Alexander <admin@m-a-styles.de>2017-07-16 11:17:36 +0200
commit4ed45c4e1276335ff6581a4db58b0173c9905528 (patch)
treeeb0aa1ae403aaadfc876dfe76e97ffb716434e51 /phpBB/includes
parentc99820eb6b13e928fdc2138840e0ec77cd4fe6c9 (diff)
parent90a77ba9d3e97718e9da7d1ee95ece4e756d26b7 (diff)
downloadforums-4ed45c4e1276335ff6581a4db58b0173c9905528.tar
forums-4ed45c4e1276335ff6581a4db58b0173c9905528.tar.gz
forums-4ed45c4e1276335ff6581a4db58b0173c9905528.tar.bz2
forums-4ed45c4e1276335ff6581a4db58b0173c9905528.tar.xz
forums-4ed45c4e1276335ff6581a4db58b0173c9905528.zip
Merge pull request #32 from phpbb/ticket/security-203
[ticket/security-203] Fully validate version check data in version helper
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index ba448f3125..84178f74e4 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3442,6 +3442,11 @@ function get_preg_expression($mode)
case 'path_remove_dot_trailing_slash':
return '#^(?:(\.)?)+(?:(.+)?)+(?:([\\/\\\])$)#';
break;
+
+ case 'semantic_version':
+ // Regular expression to match semantic versions by http://rgxdb.com/
+ return '/(?<=^[Vv]|^)(?:(?<major>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<minor>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<patch>(?:0|[1-9](?:(?:0|[1-9])+)*))(?:-(?<prerelease>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*)))*))?(?:[+](?<build>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+)))*))?)$/';
+ break;
}
return '';