Skip to content

Commit 95dc7e1

Browse files
committed
addresses peer review discovered issue, reverts the test change from previous commit
1 parent f2381d9 commit 95dc7e1

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

jspwiki-210-adapters/src/test/java/org/apache/wiki/filters/FilterFrom210Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ public void testFilterNotUsingPublicApiStillWorks() throws WikiException {
4545
final TwoXFilter txf = ( TwoXFilter )fm.getFilterList().stream().filter( f -> f instanceof TwoXFilter ).findAny().get();
4646
// post save triggers page references' update which in turn renders the page, which in turn triggers the preTranslate
4747
// filter method, so we end up with 5 invocations to any given filter on a page save + 1 more from initialize
48-
Assertions.assertEquals( 3, txf.invocations() );
48+
Assertions.assertEquals( 6, txf.invocations() );
4949

5050
final WikiContext context = new WikiContext( engine, new WikiPage( engine, "Testpage" ) );
5151
final String res = rm.textToHTML( context,"Incredible and super important content here" ); // test only pre / post translate
52-
Assertions.assertEquals( "Incredible and super important content here", res );
52+
Assertions.assertEquals( "see how I care about yor content - hmmm...", res );
5353
}
5454

5555
}

jspwiki-main/src/main/java/org/apache/wiki/variables/DefaultVariableManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,16 @@ public String getValue( final Context context, final String varName ) throws Ill
153153
}
154154
// Faster than doing equalsIgnoreCase()
155155
final String name = varName.toLowerCase();
156-
if ( name.startsWith( "jspwiki" ) ) {
156+
if (!"jspwiki.frontpage".equals(name) &&
157+
!"jspwiki.runfilters".equals(name) &&
158+
name.startsWith( "jspwiki" ) ) {
157159
LOG.warn("variable manager is denying access to '" + name + "'");
158160
return "";
159161
}
160162
for( final String value : THE_BIG_NO_NO_LIST ) {
161163
if( name.equals( value ) ) {
162164
return ""; // FIXME: Should this be something different?
163165
}
164-
if ("jspwiki.frontpage".equals(name)) continue;
165-
if ("jspwiki.runfilters".equals(name) ) continue;
166166
}
167167

168168
try {

0 commit comments

Comments
 (0)