Skip to content

Commit

Permalink
Correct the key used in changeRule(), ensure no double new rule.
Browse files Browse the repository at this point in the history
However, I'm still wondering what's the goal in it, overwriting the rule's
parse and render methods should be the right way ...


git-svn-id: https://svn.php.net/repository/pear/packages/Text_Wiki/trunk@207184 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
bertrand Gugger committed Feb 15, 2006
1 parent e114abb commit 568c4ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Text/Wiki.php
Expand Up @@ -741,7 +741,9 @@ function changeRule($old, $new)
$new = ucwords(strtolower($new));
$key = array_search($old, $this->rules);
if ($key !== false) {
$this->rules[$old] = $new;
// delete the new name , case it was already there
$this->deleteRule($new);
$this->rules[$key] = $new;
}
}

Expand Down

0 comments on commit 568c4ec

Please sign in to comment.