From ccd149f689cc92f85f22311401d7de51d9cd1c55 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 5 Nov 2008 14:23:17 +0000 Subject: [PATCH] BUGFIX Reverted text replacement performance improvement in SQLQuery - it was replacing more ocurrences via str_replace() than the previous implementation based on arrays, which broke queries augmented by Translatable (originally committed in r60468 and r54044) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65291 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SQLQuery.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/core/model/SQLQuery.php b/core/model/SQLQuery.php index 3f1d64b42..ce1da7c67 100755 --- a/core/model/SQLQuery.php +++ b/core/model/SQLQuery.php @@ -65,8 +65,6 @@ class SQLQuery extends Object { */ public $delete = false; - private $replacements = array(); - /** * The logical connective used to join WHERE clauses. Defaults to AND. * @var string @@ -354,8 +352,6 @@ class SQLQuery extends Object { * @param string $new The new text. */ function replaceText($old, $new) { - $this->replacements[] = array($old, $new); - /* if($this->select) foreach($this->select as $i => $item) $this->select[$i] = str_replace($old, $new, $item); @@ -378,7 +374,6 @@ class SQLQuery extends Object { foreach($this->having as $i => $item) $this->having[$i] = str_replace($old, $new, $item); } - */ } /** @@ -411,10 +406,6 @@ class SQLQuery extends Object { if($this->orderby) $text .= " ORDER BY " . $this->orderby; if($this->limit) $text .= " LIMIT " . $this->limit; - foreach($this->replacements as $replacement) { - $text = str_replace($replacement[0], $replacement[1], $text); - } - return $text; }