From 6fceaf205a341c2134457bf9f24a7a7f2fba63e0 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Mon, 31 Jan 2011 22:18:02 +0000 Subject: characters / [ and ] are now allowed for the model name --- .../Application/Controllers/GenericController.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'h-source/Application/Controllers/GenericController.php') diff --git a/h-source/Application/Controllers/GenericController.php b/h-source/Application/Controllers/GenericController.php index c8174ab..5c96b76 100644 --- a/h-source/Application/Controllers/GenericController.php +++ b/h-source/Application/Controllers/GenericController.php @@ -210,7 +210,7 @@ class GenericController extends BaseController $name = encodeUrl($ne_name); $data['name'] = $name; $data['ne_name'] = $ne_name; - $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($clean['id_hard'],$name) . " » edit"; + $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($clean['id_hard'],$ne_name) . " » edit"; if (isset($_POST['updateAction'])) { @@ -419,7 +419,7 @@ class GenericController extends BaseController $data['id'] = $clean['id']; $data['ne_name'] = $this->m['HardwareModel']->getTheModelName($clean['id']); $data['name'] = encodeUrl($data['ne_name']); - $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($clean['id'],$data['name'])." » history"; + $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($clean['id'],$data['ne_name'])." » history"; $data['title'] = 'history - '.Website::$generalName; @@ -474,7 +474,7 @@ class GenericController extends BaseController $data['id_hard'] = (int)$data['table'][0]['revisions']['id_hard']; $data['ne_name'] = $this->m['HardwareModel']->getTheModelName($data['id_hard']); $data['name'] = encodeUrl($data['ne_name']); - $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($data['id_hard'],$data['name'])." » " . $this->getHistoryLink($data['id_hard']) . " » revision"; + $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($data['id_hard'],$data['ne_name'])." » " . $this->getHistoryLink($data['id_hard']) . " » revision"; $data['title'] = 'revision - '.Website::$generalName; @@ -496,8 +496,9 @@ class GenericController extends BaseController $clean['id_rev'] = (int)$id_rev; $data['id_hard'] = $clean['id_hard']; - $data['name'] = encodeUrl($this->m['HardwareModel']->getTheModelName((int)$data['id_hard'])); - $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($data['id_hard'],$data['name'])." » " . $this->getHistoryLink($clean['id_hard']) . " » differences"; + $ne_name = $this->m['HardwareModel']->getTheModelName((int)$data['id_hard']); + $data['name'] = encodeUrl($ne_name); + $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($data['id_hard'],$ne_name)." » " . $this->getHistoryLink($clean['id_hard']) . " » differences"; $data['showDiff'] = false; @@ -578,7 +579,7 @@ class GenericController extends BaseController $data['id_hard'] = $clean['id_hard']; $data['ne_name'] = $this->m['HardwareModel']->getTheModelName($clean['id_hard']); $data['name'] = encodeUrl($data['ne_name']); - $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($data['id_hard'],$data['name'])." » " . $this->getHistoryLink($clean['id_hard']) . " » make current"; + $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($data['id_hard'],$data['ne_name'])." » " . $this->getHistoryLink($clean['id_hard']) . " » make current"; $data['notice'] = null; $this->s['registered']->checkStatus(); @@ -628,7 +629,7 @@ class GenericController extends BaseController $data['id_hard'] = $clean['id_hard']; $data['ne_name'] = $this->m['HardwareModel']->getTheModelName($clean['id_hard']); $data['name'] = encodeUrl($data['ne_name']); - $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($clean['id_hard'],$data['name'])." » talk"; + $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($clean['id_hard'],$data['ne_name'])." » talk"; if (isset($_POST['insertAction'])) { @@ -658,9 +659,10 @@ class GenericController extends BaseController $this->loadViewAll('talk,moderator_dialog'); } - protected function getViewLink($id,$name) + protected function getViewLink($id,$ne_name) { - return "controller.'/view/'.$this->lang.'/'.$id.'/'.$name.$this->viewStatus."'>".urldecode($name).""; +// $text = isset() + return "controller.'/view/'.$this->lang.'/'.$id.'/'.encodeUrl($ne_name).$this->viewStatus."'>".$ne_name.""; } protected function getHistoryLink($id) -- cgit v1.2.3