Permalink
Browse files

Refactoring for sakura internet

  • Loading branch information...
1 parent 47bb6f5 commit ab6e5ccacfce3114b80f461b68d637b8edc439f9 @mcatm committed Sep 27, 2010
Showing with 12 additions and 10 deletions.
  1. +2 −1 config/config.php
  2. +4 −1 helpers/BLX_url_helper.php
  3. +6 −8 libraries/BLX_Input.php
View
@@ -42,7 +42,8 @@
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/
-$config['uri_protocol'] = "REQUEST_URI";
+if (!defined('URI_PROTOCOL')) define ('URI_PROTOCOL', 'REQUEST_URI');
+$config['uri_protocol'] = URI_PROTOCOL;
/*
|--------------------------------------------------------------------------
@@ -27,7 +27,10 @@ function self_url($url = "") {
$CI =& get_instance();
$delimiter = $CI->config->config['index_page'].'/';
if ($url == "") $url = $_SERVER['PHP_SELF'];
- if ($_SERVER['QUERY_STRING'] != "") $url .= '?'.$_SERVER['QUERY_STRING'];
+ if ($_SERVER['QUERY_STRING'] != ""){
+ $url .= (!defined('URI_PROTOCOL') || URI_PROTOCOL != 'QUERY_STRING') ? '?' : '';
+ $url .= $_SERVER['QUERY_STRING'];
+ }
$url = base_url() . substr($url, strpos($url, $delimiter) + strlen($delimiter));
return $url;
}
View
@@ -62,14 +62,14 @@ function _sanitize_globals()
# need to refactor below lines. IT MUST BE CLEANED $_GET.
- /*if ($this->allow_get_array == FALSE)
+ if ($this->allow_get_array == FALSE)
{
$_GET = array();
}
else
{
$_GET = $this->_clean_input_data($_GET);
- }*/
+ }
// Clean $_POST Data
$_POST = $this->_clean_input_data($_POST);
@@ -101,8 +101,6 @@ function _sanitize_globals()
return $new_array;
}
- print_r($str);exit;
-
// We strip slashes if magic quotes is on to keep things consistent
if (get_magic_quotes_gpc())
{
@@ -122,19 +120,19 @@ function _sanitize_globals()
}
return $str;
- }
+ }*/
function _clean_input_keys($str)//さくら/Multiviews対策
{
#$str = str_replace('_php', '', $str);
#print $str.'<hr />';
- if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
+ /*if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
{
exit('Disallowed Key Characters!');
- }
+ }*/
return $str;
- }*/
+ }
/*function _sanitize_globals() {
$this->allow_get_array = TRUE;

0 comments on commit ab6e5cc

Please sign in to comment.