Swapped out str_replace() for strtr()

git-svn-id: http://svn.cleancode.org/svn/pickles@77 4d10bc64-7434-11dc-a737-d2d0f8310089
This commit is contained in:
Josh Sherman 2008-10-17 19:16:55 +00:00
parent 47b3271bde
commit 52b58b81e7
2 changed files with 4 additions and 4 deletions

View file

@ -95,7 +95,7 @@ class Controller extends Object {
}
// Grab the passed in model or use the default
$model_name = isset($_REQUEST['model']) ? str_replace('-', '_', $_REQUEST['model']) : $config->getDefaultModel();
$model_name = isset($_REQUEST['model']) ? strtr($_REQUEST['model'], '-', '_') : $config->getDefaultModel();
/**
* @todo Maybe the logout shouldn't be an internal thing, what if the
@ -120,7 +120,7 @@ class Controller extends Object {
$event = null;
}
else {
$class = str_replace('/', '_', $model_name);
$class = strtr($model_name, '/', '_');
list($section, $event) = split('/', $model_name);
}
@ -142,7 +142,7 @@ class Controller extends Object {
$class = $shared_model_name;
}
else {
$class = str_replace('/', '_', $shared_model_name);
$class = strtr($shared_model_name, '/', '_');
}
if (class_exists($class)) {

View file

@ -74,7 +74,7 @@ class Mailer extends Object {
$prefix = isset($this->prefix) ? $this->prefix : (isset($defaults->prefix) && $defaults->prefix != '' ? $defaults->prefix : null);
// Assembles the subject line with prefix
$subject = str_replace("\n", '', (isset($prefix) ? '[' . $prefix . '] ' : ''));
$subject = strtr((isset($prefix) ? '[' . $prefix . '] ' : ''), "\n", '');
// Tacks on the subject
if (isset($this->subject)) {