aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2012-11-29 15:29:42 -0500
committerSteve Clay <steve@mrclay.org>2012-11-29 15:29:42 -0500
commitacdb5bf2b7e516ece1ab60256235973d2bfb0b04 (patch)
treec95aac84aaefac0e9b3899232e3176b017418441
parent2ac189cb0ab26c10e7feda980402d54e5b6dbf3e (diff)
downloadelgg-acdb5bf2b7e516ece1ab60256235973d2bfb0b04.tar.gz
elgg-acdb5bf2b7e516ece1ab60256235973d2bfb0b04.tar.bz2
Don't need htmlawed for ?view, prevent "Array" from being used as view type
-rw-r--r--engine/lib/views.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/engine/lib/views.php b/engine/lib/views.php
index 8a0642c2b..8b10fe3e0 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -101,15 +101,15 @@ function elgg_get_viewtype() {
return $CURRENT_SYSTEM_VIEWTYPE;
}
- $viewtype = get_input('view', NULL);
- if ($viewtype) {
+ $viewtype = get_input('view', '', false);
+ if (is_string($viewtype) && $viewtype !== '') {
// only word characters allowed.
- if (!preg_match('[\W]', $viewtype)) {
+ if (!preg_match('/\W/', $viewtype)) {
return $viewtype;
}
}
- if (isset($CONFIG->view) && !empty($CONFIG->view)) {
+ if (!empty($CONFIG->view)) {
return $CONFIG->view;
}