summaryrefslogtreecommitdiffstats
path: root/tests/mocks/core
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-01-15 14:51:08 +0100
committerAndrey Andreev <narf@devilix.net>2014-01-15 14:51:08 +0100
commitde14aa5a29b1b122bfd536f979dfda7f2fd9f53d (patch)
tree7f2973fed092400b14f48ba12a95837571441c33 /tests/mocks/core
parent3d215207ceff44193e3c1888b868fc3f691718c0 (diff)
CI_URI changes related to the 'permitted_uri_chars' setting
- Initialize and cache the value in the class constructor instead of searching for it every time - Removed the preg_quote() call from _filter_uri() to allow more fine-tuning from configuration - Renamed _filter_uri() to filter_uri() - it was public anyway and using it cannot break anything Related: issue #2799
Diffstat (limited to 'tests/mocks/core')
-rw-r--r--tests/mocks/core/uri.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/mocks/core/uri.php b/tests/mocks/core/uri.php
index 11078587b..96ec5afa1 100644
--- a/tests/mocks/core/uri.php
+++ b/tests/mocks/core/uri.php
@@ -10,12 +10,23 @@ class Mock_Core_URI extends CI_URI {
// set predictable config values
$test->ci_set_config(array(
'index_page' => 'index.php',
- 'base_url' => 'http://example.com/',
- 'subclass_prefix' => 'MY_'
+ 'base_url' => 'http://example.com/',
+ 'subclass_prefix' => 'MY_',
+ 'enable_query_strings' => FALSE,
+ 'permitted_uri_chars' => 'a-z 0-9~%.:_\-'
));
$this->config = new $cls;
+ if ($this->config->item('enable_query_strings') !== TRUE OR is_cli())
+ {
+ $this->_permitted_uri_chars = $this->config->item('permitted_uri_chars');
+ }
+ }
+
+ public function _set_permitted_uri_chars($value)
+ {
+ $this->_permitted_uri_chars = $value;
}
} \ No newline at end of file