mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-24 08:20:54 -04:00
Small code optimisation: use strtr instead of str_replace (#709)
This commit is contained in:
@@ -46,9 +46,9 @@ $config['ospos_xss_clean'] = TRUE;
|
||||
| a PHP script and you can easily do that on your own.
|
||||
|
|
||||
*/
|
||||
$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
|
||||
$config['base_url'] .= "://".$_SERVER['HTTP_HOST'];
|
||||
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
|
||||
$config['base_url'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
|
||||
$config['base_url'] .= '://' . $_SERVER['HTTP_HOST'];
|
||||
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -19,7 +19,7 @@ class MY_Lang extends CI_Lang
|
||||
|
||||
foreach($loaded as $file)
|
||||
{
|
||||
$this->load( str_replace( '_lang.php', '', $file ) );
|
||||
$this->load(strtr($file, '', '_lang.php'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ function load_config()
|
||||
{
|
||||
if(!is_array($file) && substr(strrchr($file,'.'), 1) == "php")
|
||||
{
|
||||
$CI->lang->load(str_replace('_lang.php', '', $file), $language);
|
||||
$CI->lang->load(strtr($file, '', '_lang.php'), $language);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user