Skip to content
Browse files

Remove useless noEscape decorator since we removed recoded strings

noEscape decorator was only used to not escape recoded strings because
it was breaking non-ascii chars that was begining by &#...;. This make
the code a bit simpler, cleaner and remove useless piece of code.
  • Loading branch information...
1 parent 6ca9379 commit 33f14343c53dc7eace1bd9e4cce96e05ca3d3514 @ioguix ioguix committed Dec 30, 2011
Showing with 17 additions and 36 deletions.
  1. +1 −1 database.php
  2. +2 −2 fulltext.php
  3. +2 −13 libraries/decorator.inc.php
  4. +8 −8 plugin_slony.php
  5. +1 −1 schemas.php
  6. +1 −9 servers.php
  7. +1 −1 tables.php
  8. +1 −1 views.php
View
2 database.php
@@ -601,7 +601,7 @@ function doTree() {
$items = $misc->adjustTabsForTree($tabs);
$attrs = array(
- 'text' => noEscape(field('title')),
+ 'text' => field('title'),
'icon' => field('icon'),
'action' => url(field('url'),
$reqvars,
View
4 fulltext.php
@@ -897,7 +897,7 @@ function doTree() {
$reqvars = $misc->getRequestVars('ftscfg');
$attrs = array(
- 'text' => noEscape(field('title')),
+ 'text' => field('title'),
'icon' => field('icon'),
'action' => url('fulltext.php',
$reqvars,
@@ -940,7 +940,7 @@ function doSubTree($what) {
$reqvars = $misc->getRequestVars('ftscfg');
$attrs = array(
- 'text' => noEscape(field('name')),
+ 'text' => field('name'),
'icon' => $what,
'toolTip'=> field('comment'),
'action' => url('fulltext.php',
View
15 libraries/decorator.inc.php
@@ -41,14 +41,6 @@ function url($base, $vars = null /* ... */) {
return new UrlDecorator($base, $vars);
}
-function noEscape($value) {
- if (is_a($value, 'Decorator')) {
- $value->esc = false;
- return $value;
- }
- return new Decorator($value, false);
-}
-
function replace($str, $params) {
return new replaceDecorator($str, $params);
}
@@ -58,10 +50,10 @@ function replace($str, $params) {
function value(&$var, &$fields, $esc = null) {
if (is_a($var, 'Decorator')) {
$val = $var->value($fields);
- if (!$var->esc) $esc = null;
} else {
$val =& $var;
}
+
if (is_string($val)) {
switch($esc) {
case 'xml':
@@ -99,11 +91,8 @@ function value_url(&$var, &$fields) {
class Decorator
{
- var $esc = true;
-
- function Decorator($value, $esc = true) {
+ function Decorator($value) {
$this->v = $value;
- $this->esc = $esc;
}
function value($fields) {
View
16 plugin_slony.php
@@ -56,7 +56,7 @@ function doTree($subject) {
$items = $misc->adjustTabsForTree($tabs);
$attrs = array(
- 'text' => noEscape(field('title')),
+ 'text' => field('title'),
'icon' => field('icon'),
'action' => url(field('url'),
$reqvars,
@@ -84,7 +84,7 @@ function doTree($subject) {
$items = $misc->adjustTabsForTree($tabs);
$attrs = array(
- 'text' => noEscape(field('title')),
+ 'text' => field('title'),
'icon' => field('icon'),
'action' => url(field('url'),
$reqvars,
@@ -113,7 +113,7 @@ function doTree($subject) {
$items = $misc->adjustTabsForTree($tabs);
$attrs = array(
- 'text' => noEscape(field('title')),
+ 'text' => field('title'),
'icon' => field('icon'),
'action' => url(field('url'),
$reqvars,
@@ -172,7 +172,7 @@ function doTree($subject) {
$items = $misc->adjustTabsForTree($tabs);
$attrs = array(
- 'text' => noEscape(field('title')),
+ 'text' => field('title'),
'icon' => field('icon'),
'action' => url(field('url'),
$reqvars,
@@ -199,7 +199,7 @@ function doTree($subject) {
$items = $misc->adjustTabsForTree($tabs);
$attrs = array(
- 'text' => noEscape(field('title')),
+ 'text' => field('title'),
'icon' => field('icon'),
'action' => url(field('url'),
$reqvars,
@@ -284,7 +284,7 @@ function doTree($subject) {
$items = $misc->adjustTabsForTree($tabs);
$attrs = array(
- 'text' => noEscape(field('title')),
+ 'text' => field('title'),
'icon' => field('icon'),
'action' => url(field('url'),
$reqvars,
@@ -311,7 +311,7 @@ function doTree($subject) {
$items = $misc->adjustTabsForTree($tabs);
$attrs = array(
- 'text' => noEscape(field('title')),
+ 'text' => field('title'),
'icon' => field('icon'),
'action' => url(field('url'),
$reqvars,
@@ -339,7 +339,7 @@ function doTree($subject) {
$items = $misc->adjustTabsForTree($tabs);
$attrs = array(
- 'text' => noEscape(field('title')),
+ 'text' => field('title'),
'icon' => field('icon'),
'action' => url(field('url'),
$reqvars,
View
2 schemas.php
@@ -396,7 +396,7 @@ function doSubTree() {
$reqvars = $misc->getRequestVars('schema');
$attrs = array(
- 'text' => noEscape(field('title')),
+ 'text' => field('title'),
'icon' => field('icon'),
'action' => url(field('url'),
$reqvars,
View
10 servers.php
@@ -133,16 +133,8 @@ function doGroupsTree() {
$groups = $misc->getServersGroups();
- function escape($fields) {
- global $lang;
- if ($fields['id'] === 'all') {
- return $lang['strallservers'];
- }
- else return value(field('desc'), $fields, 'xml');
- }
-
$attrs = array(
- 'text' => noEscape(callback('escape')),
+ 'text' => field('desc'),
'icon' => 'Servers',
'action' => url('servers.php',
array(
View
2 tables.php
@@ -878,7 +878,7 @@ function doSubTree() {
$reqvars = $misc->getRequestVars('table');
$attrs = array(
- 'text' => noEscape(field('title')),
+ 'text' => field('title'),
'icon' => field('icon'),
'action' => url(
field('url'),
View
2 views.php
@@ -660,7 +660,7 @@ function doSubTree() {
$reqvars = $misc->getRequestVars('view');
$attrs = array(
- 'text' => noEscape(field('title')),
+ 'text' => field('title'),
'icon' => field('icon'),
'action' => url(field('url'), $reqvars, field('urlvars'), array('view' => $_REQUEST['view'])),
'branch' => ifempty(

0 comments on commit 33f1434

Please sign in to comment.
Something went wrong with that request. Please try again.