Permalink
Browse files

for issue #660

To avoid unsafe operation

Signed-off-by: Buddhima Wijeweera <buddhimawijeweera@yahoo.com>
  • Loading branch information...
1 parent 4f132a9 commit 532ca47e462be817c40c481bacea0f5bfd1d7729 @Buddhima committed Apr 1, 2012
Showing with 11 additions and 4 deletions.
  1. +11 −4 libraries/joomla/html/editor.php
View
15 libraries/joomla/html/editor.php
@@ -455,11 +455,18 @@ public function getButtons($editor, $buttons = true)
$plugin = new $className($this, (array) $plugin);
}
+ try{
// Try to authenticate
- if ($temp = $plugin->onDisplay($editor, $this->asset, $this->author))
- {
- $result[] = $temp;
- }
+ // Unsafe opearation, might cause an exception if $className not exists
+
+ if ($temp = $plugin->onDisplay($editor, $this->asset, $this->author))
+ {
+ $result[] = $temp;
+ }
+ } catch (Exception $e){
+ echo 'Exception while authenticating.';
+ echo 'Message '.$e->getMessage(); // print the error message
+ }
}
return $result;

0 comments on commit 532ca47

Please sign in to comment.