Skip to content

Commit 5def7cc

Browse files
Merge commit from fork
DNNImageHandler - Add Option to prevent URL text from appearing as content
2 parents 7e86029 + de184b3 commit 5def7cc

File tree

5 files changed

+95
-78
lines changed

5 files changed

+95
-78
lines changed

DNN Platform/Library/Services/GeneratedImage/DnnImageHandler.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace DotNetNuke.Services.GeneratedImage
1717
using System.Web;
1818

1919
using DotNetNuke.Common;
20+
using DotNetNuke.Common.Utilities;
2021
using DotNetNuke.Entities.Portals;
2122
using DotNetNuke.Services.FileSystem;
2223
using DotNetNuke.Services.GeneratedImage.FilterTransform;
@@ -177,7 +178,11 @@ public override ImageInfo GenerateImage(NameValueCollection parameters)
177178

178179
if (!string.IsNullOrEmpty(parameters["Text"]))
179180
{
180-
placeHolderTrans.Text = text;
181+
bool.TryParse(Config.GetSetting("AllowDnnImagePlaceholderText"), out bool allowDnnImagePlaceholderText);
182+
if (allowDnnImagePlaceholderText)
183+
{
184+
placeHolderTrans.Text = text;
185+
}
181186
}
182187

183188
if (!string.IsNullOrEmpty(parameters["BackColor"]))
@@ -265,7 +270,6 @@ public override ImageInfo GenerateImage(NameValueCollection parameters)
265270
break;
266271

267272
default:
268-
269273
string imageTransformClass = ConfigurationManager.AppSettings["DnnImageHandler." + mode];
270274
string[] imageTransformClassParts = imageTransformClass.Split(',');
271275
var asm = Assembly.LoadFrom(Globals.ApplicationMapPath + @"\bin\" +

DNN Platform/Website/DotNetNuke.Website.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,7 @@
12541254
<Content Include="Providers\DataProviders\SqlDataProvider\09.11.01.SqlDataProvider" />
12551255
<Content Include="Providers\DataProviders\SqlDataProvider\09.11.02.SqlDataProvider" />
12561256
<Content Include="Providers\DataProviders\SqlDataProvider\09.12.01.SqlDataProvider" />
1257+
<Content Include="Install\Config\09.13.04.config" />
12571258
<Content Include="Providers\DataProviders\SqlDataProvider\09.13.04.SqlDataProvider" />
12581259
<None Include="web.Debug.config">
12591260
<DependentUpon>web.config</DependentUpon>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<configuration>
2+
<nodes configfile="web.config">
3+
<node path="/configuration/appSettings" action="add">
4+
<!-- Can be set to true to allow the image handler to display text passed in the querystring. -->
5+
<add key="AllowDnnImagePlaceholderText" value="false" />
6+
</node>
7+
</nodes>
8+
</configuration>

DNN Platform/Website/development.config

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
<connectionStrings>
3838
<!-- Connection String for SQL Server 2008/2012 Express -->
3939
<add name="SiteSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Database.mdf;" providerName="System.Data.SqlClient"/>
40-
<!-- Connection String for SQL Server 2008/2012
41-
<add name="SiteSqlServer" connectionString="Server=(local);Database=DotNetNuke;uid=;pwd=;" providerName="System.Data.SqlClient" />
40+
<!-- Connection String for SQL Server 2008/2012
41+
<add name="SiteSqlServer" connectionString="Server=(local);Database=DotNetNuke;uid=;pwd=;" providerName="System.Data.SqlClient" />
4242
-->
4343
</connectionStrings>
4444

@@ -55,7 +55,7 @@
5555
<!--optionally strip angle brackets on public login and registration screens-->
5656
<add key="PersistentCookieTimeout" value="0"/>
5757
<!--use as persistent cookie expiration. Value is in minutes, and only active if a non-zero figure-->
58-
<!-- set UsePortNumber to true to preserve the port number if you're using a port number other than 80 (the standard)
58+
<!-- set UsePortNumber to true to preserve the port number if you're using a port number other than 80 (the standard)
5959
<add key="UsePortNumber" value="true" /> -->
6060
<!-- Services Framework Tracing is primarily useful for developing and debugging -->
6161
<add key="EnableServicesFrameworkTracing" value="false" />
@@ -64,7 +64,9 @@
6464
<add key="loginUrl" value="~/Login.aspx" />
6565
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
6666
<add key="MobileViewSiteCookieName" value="dnn_IsMobile" />
67-
<add key="DisableMobileViewSiteCookieName" value="dnn_NoMobile" />
67+
<add key="DisableMobileViewSiteCookieName" value="dnn_NoMobile" />
68+
<!-- Can be set to true to allow the image handler to display text passed in the querystring. -->
69+
<add key="AllowDnnImagePlaceholderText" value="false" />
6870
</appSettings>
6971

7072
<system.web.webPages.razor>
@@ -148,19 +150,19 @@
148150
<authentication mode="Forms">
149151
<forms name=".DOTNETNUKE" protection="All" timeout="60" cookieless="UseCookies"/>
150152
</authentication>
151-
<!--
152-
<identity impersonate="true"/>
153-
<authentication mode="Windows">
154-
</authentication>
153+
<!--
154+
<identity impersonate="true"/>
155+
<authentication mode="Windows">
156+
</authentication>
155157
-->
156158
<!-- allow large file uploads -->
157159
<httpRuntime targetFramework="4.7.2" shutdownTimeout="120" executionTimeout="1200" useFullyQualifiedRedirectUrl="true" maxRequestLength="28672" requestLengthDiskThreshold="81920" maxUrlLength="2048" requestPathInvalidCharacters="&lt;,&gt;,*,%,:,\,?" enableVersionHeader="false" requestValidationMode="2.0" fcnMode="Single" />
158160
<httpCookies httpOnlyCookies="true" requireSSL="false" domain=""/>
159-
<!-- GLOBALIZATION
160-
This section sets the globalization settings of the application.
161-
Utf-8 is not supported on Netscape 4.x
162-
If you need netscape compatiblity leave iso-8859-1.
163-
UTF-8 is recommended for complex languages
161+
<!-- GLOBALIZATION
162+
This section sets the globalization settings of the application.
163+
Utf-8 is not supported on Netscape 4.x
164+
If you need netscape compatiblity leave iso-8859-1.
165+
UTF-8 is recommended for complex languages
164166
-->
165167
<globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8"/>
166168
<!--<globalization culture="en-US" uiCulture="en" fileEncoding="iso-8859-1" requestEncoding="iso-8859-1" responseEncoding="iso-8859-1"/>-->
@@ -192,33 +194,33 @@
192194
</controls>
193195
</pages>
194196
<!-- ASP.NET 2 Membership/Profile/Role and AnonymousAuthentication Providers -->
195-
<!-- anonymousIdentification configuration:
196-
enabled="[true|false]" Feature is enabled?
197-
cookieName=".ASPXANONYMOUS" Cookie Name
198-
cookieTimeout="100000" Cookie Timeout in minutes
199-
cookiePath="/" Cookie Path
200-
cookieRequireSSL="[true|false]" Set Secure bit in Cookie
201-
cookieSlidingExpiration="[true|false]" Reissue expiring cookies?
202-
cookieProtection="[None|Validation|Encryption|All]" How to protect cookies from being read/tampered
203-
domain="[domain]" Enables output of the "domain" cookie attribute set to the specified value
197+
<!-- anonymousIdentification configuration:
198+
enabled="[true|false]" Feature is enabled?
199+
cookieName=".ASPXANONYMOUS" Cookie Name
200+
cookieTimeout="100000" Cookie Timeout in minutes
201+
cookiePath="/" Cookie Path
202+
cookieRequireSSL="[true|false]" Set Secure bit in Cookie
203+
cookieSlidingExpiration="[true|false]" Reissue expiring cookies?
204+
cookieProtection="[None|Validation|Encryption|All]" How to protect cookies from being read/tampered
205+
domain="[domain]" Enables output of the "domain" cookie attribute set to the specified value
204206
-->
205207
<anonymousIdentification enabled="true" cookieName=".ASPXANONYMOUS" cookieTimeout="100000" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="None" domain=""/>
206208
<membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="15">
207209
<providers>
208210
<clear/>
209-
<!-- Configuration for AspNetSqlMembershipProvider:
210-
connectionStringName="string" Name corresponding to the entry in <connectionStrings> section where the connection string for the provider is specified
211-
maxInvalidPasswordAttempts="int" The number of failed password attempts, or failed password answer attempts that are allowed before locking out a user?s account
212-
passwordAttemptWindow="int" The time window, in minutes, during which failed password attempts and failed password answer attempts are tracked
213-
enablePasswordRetrieval="[true|false]" Should the provider support password retrievals
214-
enablePasswordReset="[true|false]" Should the provider support password resets
215-
requiresQuestionAndAnswer="[true|false]" Should the provider require Q & A
216-
minRequiredPasswordLength="int" The minimum password length
217-
minRequiredNonalphanumericCharacters="int" The minimum number of non-alphanumeric characters
218-
applicationName="string" Optional string to identity the application: defaults to Application Metabase path
219-
requiresUniqueEmail="[true|false]" Should the provider require a unique email to be specified
220-
passwordFormat="[Clear|Hashed|Encrypted]" Storage format for the password: Hashed (SHA1), Clear or Encrypted (Triple-DES)
221-
description="string" Description of what the provider does
211+
<!-- Configuration for AspNetSqlMembershipProvider:
212+
connectionStringName="string" Name corresponding to the entry in <connectionStrings> section where the connection string for the provider is specified
213+
maxInvalidPasswordAttempts="int" The number of failed password attempts, or failed password answer attempts that are allowed before locking out a user?s account
214+
passwordAttemptWindow="int" The time window, in minutes, during which failed password attempts and failed password answer attempts are tracked
215+
enablePasswordRetrieval="[true|false]" Should the provider support password retrievals
216+
enablePasswordReset="[true|false]" Should the provider support password resets
217+
requiresQuestionAndAnswer="[true|false]" Should the provider require Q & A
218+
minRequiredPasswordLength="int" The minimum password length
219+
minRequiredNonalphanumericCharacters="int" The minimum number of non-alphanumeric characters
220+
applicationName="string" Optional string to identity the application: defaults to Application Metabase path
221+
requiresUniqueEmail="[true|false]" Should the provider require a unique email to be specified
222+
passwordFormat="[Clear|Hashed|Encrypted]" Storage format for the password: Hashed (SHA1), Clear or Encrypted (Triple-DES)
223+
description="string" Description of what the provider does
222224
-->
223225
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="SiteSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" requiresUniqueEmail="false" passwordFormat="Hashed" applicationName="DotNetNuke" description="Stores and retrieves membership data from the local Microsoft SQL Server database"/>
224226
</providers>
@@ -443,8 +445,8 @@
443445
<compositeFiles defaultFileProcessingProvider="DnnCompositeFileProcessor" compositeFileHandlerPath="~/DependencyHandler.axd">
444446
<fileProcessingProviders>
445447
<add name="CompositeFileProcessor" type="ClientDependency.Core.CompositeFiles.Providers.CompositeFileProcessingProvider, ClientDependency.Core" enableCssMinify="false" enableJsMinify="true" persistFiles="true" compositeFilePath="~/App_Data/ClientDependency" bundleDomains="" urlType="MappedId" />
446-
<!-- For webfarms remove the above CompositeFileProcessor and uncomment this section
447-
<add name="CompositeFileProcessor" type="ClientDependency.Core.CompositeFiles.Providers.CompositeFileProcessingProvider, ClientDependency.Core" enableCssMinify="false" enableJsMinify="true" persistFiles="true" compositeFilePath="~/App_Data/ClientDependency" bundleDomains="" urlType="Base64QueryStrings" />
448+
<!-- For webfarms remove the above CompositeFileProcessor and uncomment this section
449+
<add name="CompositeFileProcessor" type="ClientDependency.Core.CompositeFiles.Providers.CompositeFileProcessingProvider, ClientDependency.Core" enableCssMinify="false" enableJsMinify="true" persistFiles="true" compositeFilePath="~/App_Data/ClientDependency" bundleDomains="" urlType="Base64QueryStrings" />
448450
-->
449451
<add name="DnnCompositeFileProcessor" type="DotNetNuke.Web.Client.Providers.DnnCompositeFileProcessingProvider, DotNetNuke.Web.Client" enableCssMinify="false" enableJsMinify="true" persistFiles="true" compositeFilePath="~/App_Data/ClientDependency" bundleDomains="" urlType="MappedId" />
450452
</fileProcessingProviders>

0 commit comments

Comments
 (0)