summaryrefslogtreecommitdiff
path: root/app/frontend/url
diff options
context:
space:
mode:
Diffstat (limited to 'app/frontend/url')
-rw-r--r--app/frontend/url/UrlManager.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/frontend/url/UrlManager.php b/app/frontend/url/UrlManager.php
index a33d98e..1310eaf 100644
--- a/app/frontend/url/UrlManager.php
+++ b/app/frontend/url/UrlManager.php
@@ -15,7 +15,9 @@ class UrlManager extends TUrlMapping {
return rtrim(
preg_replace(
'#^/' . $serviceParam . '#',
- '/' . $this->_convertServiceParam($serviceParam),
+ '/' . $this->_convertServiceParam(
+ TPropertyValue::ensureString($serviceParam)
+ ),
preg_replace('#^/' . $serviceID . '#', '', $url)
),
'/'
@@ -27,7 +29,9 @@ class UrlManager extends TUrlMapping {
if ($this->MatchingPattern) {
$serviceID = $this->MatchingPattern->ServiceID;
if (isset($params[$serviceID])) {
- $params[$serviceID] = $this->_parseServiceParam($params[$serviceID]);
+ $params[$serviceID] = $this->_parseServiceParam(
+ TPropertyValue::ensureString($params[$serviceID])
+ );
}
}
return $params;
@@ -36,7 +40,7 @@ class UrlManager extends TUrlMapping {
/**
* Convert service param from camelCase to hyphenated-form.
**/
- private function _convertServiceParam($param) {
+ private function _convertServiceParam(string $param = '') {
return implode(
'-',
array_map('mb_strtolower', array_filter(preg_split('/(?=[A-Z])/', $param)))
@@ -46,7 +50,7 @@ class UrlManager extends TUrlMapping {
/**
* Convert service param from hyphenated-form to camelCase.
**/
- private function _parseServiceParam($param) {
+ private function _parseServiceParam(string $param = '') {
return implode(
'',
array_map('ucfirst', explode('-', $param))