Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 33f14343c53dc7eace1bd9e4cce96e05ca3d3514 1 parent 6ca9379
Jehan-Guillaume (ioguix) de Rorthais ioguix authored
2  database.php
@@ -601,7 +601,7 @@ function doTree() {
601 601 $items = $misc->adjustTabsForTree($tabs);
602 602
603 603 $attrs = array(
604   - 'text' => noEscape(field('title')),
  604 + 'text' => field('title'),
605 605 'icon' => field('icon'),
606 606 'action' => url(field('url'),
607 607 $reqvars,
4 fulltext.php
@@ -897,7 +897,7 @@ function doTree() {
897 897 $reqvars = $misc->getRequestVars('ftscfg');
898 898
899 899 $attrs = array(
900   - 'text' => noEscape(field('title')),
  900 + 'text' => field('title'),
901 901 'icon' => field('icon'),
902 902 'action' => url('fulltext.php',
903 903 $reqvars,
@@ -940,7 +940,7 @@ function doSubTree($what) {
940 940 $reqvars = $misc->getRequestVars('ftscfg');
941 941
942 942 $attrs = array(
943   - 'text' => noEscape(field('name')),
  943 + 'text' => field('name'),
944 944 'icon' => $what,
945 945 'toolTip'=> field('comment'),
946 946 'action' => url('fulltext.php',
15 libraries/decorator.inc.php
@@ -41,14 +41,6 @@ function url($base, $vars = null /* ... */) {
41 41 return new UrlDecorator($base, $vars);
42 42 }
43 43
44   -function noEscape($value) {
45   - if (is_a($value, 'Decorator')) {
46   - $value->esc = false;
47   - return $value;
48   - }
49   - return new Decorator($value, false);
50   -}
51   -
52 44 function replace($str, $params) {
53 45 return new replaceDecorator($str, $params);
54 46 }
@@ -58,10 +50,10 @@ function replace($str, $params) {
58 50 function value(&$var, &$fields, $esc = null) {
59 51 if (is_a($var, 'Decorator')) {
60 52 $val = $var->value($fields);
61   - if (!$var->esc) $esc = null;
62 53 } else {
63 54 $val =& $var;
64 55 }
  56 +
65 57 if (is_string($val)) {
66 58 switch($esc) {
67 59 case 'xml':
@@ -99,11 +91,8 @@ function value_url(&$var, &$fields) {
99 91
100 92 class Decorator
101 93 {
102   - var $esc = true;
103   -
104   - function Decorator($value, $esc = true) {
  94 + function Decorator($value) {
105 95 $this->v = $value;
106   - $this->esc = $esc;
107 96 }
108 97
109 98 function value($fields) {
16 plugin_slony.php
@@ -56,7 +56,7 @@ function doTree($subject) {
56 56 $items = $misc->adjustTabsForTree($tabs);
57 57
58 58 $attrs = array(
59   - 'text' => noEscape(field('title')),
  59 + 'text' => field('title'),
60 60 'icon' => field('icon'),
61 61 'action' => url(field('url'),
62 62 $reqvars,
@@ -84,7 +84,7 @@ function doTree($subject) {
84 84 $items = $misc->adjustTabsForTree($tabs);
85 85
86 86 $attrs = array(
87   - 'text' => noEscape(field('title')),
  87 + 'text' => field('title'),
88 88 'icon' => field('icon'),
89 89 'action' => url(field('url'),
90 90 $reqvars,
@@ -113,7 +113,7 @@ function doTree($subject) {
113 113 $items = $misc->adjustTabsForTree($tabs);
114 114
115 115 $attrs = array(
116   - 'text' => noEscape(field('title')),
  116 + 'text' => field('title'),
117 117 'icon' => field('icon'),
118 118 'action' => url(field('url'),
119 119 $reqvars,
@@ -172,7 +172,7 @@ function doTree($subject) {
172 172 $items = $misc->adjustTabsForTree($tabs);
173 173
174 174 $attrs = array(
175   - 'text' => noEscape(field('title')),
  175 + 'text' => field('title'),
176 176 'icon' => field('icon'),
177 177 'action' => url(field('url'),
178 178 $reqvars,
@@ -199,7 +199,7 @@ function doTree($subject) {
199 199 $items = $misc->adjustTabsForTree($tabs);
200 200
201 201 $attrs = array(
202   - 'text' => noEscape(field('title')),
  202 + 'text' => field('title'),
203 203 'icon' => field('icon'),
204 204 'action' => url(field('url'),
205 205 $reqvars,
@@ -284,7 +284,7 @@ function doTree($subject) {
284 284 $items = $misc->adjustTabsForTree($tabs);
285 285
286 286 $attrs = array(
287   - 'text' => noEscape(field('title')),
  287 + 'text' => field('title'),
288 288 'icon' => field('icon'),
289 289 'action' => url(field('url'),
290 290 $reqvars,
@@ -311,7 +311,7 @@ function doTree($subject) {
311 311 $items = $misc->adjustTabsForTree($tabs);
312 312
313 313 $attrs = array(
314   - 'text' => noEscape(field('title')),
  314 + 'text' => field('title'),
315 315 'icon' => field('icon'),
316 316 'action' => url(field('url'),
317 317 $reqvars,
@@ -339,7 +339,7 @@ function doTree($subject) {
339 339 $items = $misc->adjustTabsForTree($tabs);
340 340
341 341 $attrs = array(
342   - 'text' => noEscape(field('title')),
  342 + 'text' => field('title'),
343 343 'icon' => field('icon'),
344 344 'action' => url(field('url'),
345 345 $reqvars,
2  schemas.php
@@ -396,7 +396,7 @@ function doSubTree() {
396 396 $reqvars = $misc->getRequestVars('schema');
397 397
398 398 $attrs = array(
399   - 'text' => noEscape(field('title')),
  399 + 'text' => field('title'),
400 400 'icon' => field('icon'),
401 401 'action' => url(field('url'),
402 402 $reqvars,
10 servers.php
@@ -133,16 +133,8 @@ function doGroupsTree() {
133 133
134 134 $groups = $misc->getServersGroups();
135 135
136   - function escape($fields) {
137   - global $lang;
138   - if ($fields['id'] === 'all') {
139   - return $lang['strallservers'];
140   - }
141   - else return value(field('desc'), $fields, 'xml');
142   - }
143   -
144 136 $attrs = array(
145   - 'text' => noEscape(callback('escape')),
  137 + 'text' => field('desc'),
146 138 'icon' => 'Servers',
147 139 'action' => url('servers.php',
148 140 array(
2  tables.php
@@ -878,7 +878,7 @@ function doSubTree() {
878 878 $reqvars = $misc->getRequestVars('table');
879 879
880 880 $attrs = array(
881   - 'text' => noEscape(field('title')),
  881 + 'text' => field('title'),
882 882 'icon' => field('icon'),
883 883 'action' => url(
884 884 field('url'),
2  views.php
@@ -660,7 +660,7 @@ function doSubTree() {
660 660 $reqvars = $misc->getRequestVars('view');
661 661
662 662 $attrs = array(
663   - 'text' => noEscape(field('title')),
  663 + 'text' => field('title'),
664 664 'icon' => field('icon'),
665 665 'action' => url(field('url'), $reqvars, field('urlvars'), array('view' => $_REQUEST['view'])),
666 666 'branch' => ifempty(

0 comments on commit 33f1434

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