diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2003-01-29 22:16:39 +0300 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2003-01-29 22:16:39 +0300 |
commit | 50b945fca5cfaef8dcde1632bfa95c5273226b25 (patch) | |
tree | cc7d0a02d481b9bcd30ca0603389458fd5c310d9 | |
parent | 2e8b8c77000c90415823a102e1148c0118ed38f6 (diff) |
2003-01-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* System.Web/HttpRequest.cs: added BaseVirtualDir property and use it
in MapPath.
* System.Web.UI.HtmlControls/HtmlControl.cs: _tagName is now internal.
* System.Web.UI.HtmlControls/HtmlGenericControl.cs: use the field in
HtmlControl to keep the tag name.
* System.Web.Util/UrlUtils.cs: fixed Combine ().
svn path=/trunk/mcs/; revision=11027
7 files changed, 33 insertions, 10 deletions
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog index 0c3d8e41974..541a98a6232 100644 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog @@ -1,3 +1,9 @@ +2003-01-29 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * HtmlControl.cs: _tagName is now internal. + * HtmlGenericControl.cs: use the field in HtmlControl to keep the tag + name. + 2003-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com> * System.Web.UI.HtmlControls/HtmlForm.cs: render 'action' attribute. diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs index 52893ecbcf7..bae152e5898 100644 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs @@ -19,7 +19,7 @@ namespace System.Web.UI.HtmlControls{ [ToolboxItem(false)]
public abstract class HtmlControl : Control, IAttributeAccessor
{
- private string _tagName = "span";
+ internal string _tagName;
private AttributeCollection _attributes;
private bool _disabled = false;
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs index a7c4b2300e5..bd5c1432efb 100644 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs @@ -18,8 +18,6 @@ namespace System.Web.UI.HtmlControls{ [ConstructorNeedsTag] public class HtmlGenericControl : HtmlContainerControl { - private string tagName; - public HtmlGenericControl() : this ("span") { @@ -30,7 +28,7 @@ namespace System.Web.UI.HtmlControls{ { if (tag == null) tag = ""; - tagName = tag; + _tagName = tag; } [DefaultValue("")] @@ -38,8 +36,8 @@ namespace System.Web.UI.HtmlControls{ [WebCategory("Appearance")] public new string TagName { - get { return tagName; } - set { tagName = value; } + get { return _tagName; } + set { _tagName = value; } } } } diff --git a/mcs/class/System.Web/System.Web.Util/ChangeLog b/mcs/class/System.Web/System.Web.Util/ChangeLog index 15f40d2ebc6..f596576c891 100644 --- a/mcs/class/System.Web/System.Web.Util/ChangeLog +++ b/mcs/class/System.Web/System.Web.Util/ChangeLog @@ -1,3 +1,7 @@ +2003-01-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * UrlUtils.cs: fixed Combine ().
+
2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* UrlUtils.cs: fixed IsRelativeUrl and IsRootUrl.
diff --git a/mcs/class/System.Web/System.Web.Util/UrlUtils.cs b/mcs/class/System.Web/System.Web.Util/UrlUtils.cs index 4068a9b6f61..ef521f1c86b 100644 --- a/mcs/class/System.Web/System.Web.Util/UrlUtils.cs +++ b/mcs/class/System.Web/System.Web.Util/UrlUtils.cs @@ -115,7 +115,7 @@ namespace System.Web.Util }
if (relPath.Length < 3 || relPath [0] != '~' || relPath [0] == '/' || relPath [0] == '\\') {
- if (basePath == null || basePath.Length == 1 || basePath [0] == '/')
+ if (basePath == null || (basePath.Length == 1 && basePath [0] == '/'))
basePath = String.Empty;
return Reduce (basePath + "/" + relPath);
diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog index ba33cb3caf9..5ce713f26ae 100644 --- a/mcs/class/System.Web/System.Web/ChangeLog +++ b/mcs/class/System.Web/System.Web/ChangeLog @@ -1,3 +1,7 @@ +2003-01-29 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * HttpRequest.cs: added BaseVirtualDir property and use it in MapPath. + 2003-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com> * HttpRequest.cs: implemented CurrentExecutionFilePath. diff --git a/mcs/class/System.Web/System.Web/HttpRequest.cs b/mcs/class/System.Web/System.Web/HttpRequest.cs index 99105ce5b2f..ae00b88db6e 100644 --- a/mcs/class/System.Web/System.Web/HttpRequest.cs +++ b/mcs/class/System.Web/System.Web/HttpRequest.cs @@ -34,6 +34,7 @@ namespace System.Web { private string _sPath;
private string _sPathInfo;
private string _sFilePath;
+ private string baseVirtualDir;
private string _sPathTranslated;
private string _sQueryStringRaw;
private string _sRequestType;
@@ -892,6 +893,15 @@ namespace System.Web { }
}
+ internal string BaseVirtualDir {
+ get {
+ if (baseVirtualDir == null)
+ baseVirtualDir = UrlUtils.GetDirectory (FilePath);
+
+ return baseVirtualDir;
+ }
+ }
+
public byte [] BinaryRead(int count) {
int iSize = TotalBytes;
if (iSize == 0) {
@@ -945,7 +955,7 @@ namespace System.Web { public string MapPath (string VirtualPath)
{
- return MapPath (VirtualPath, RootVirtualDir, true);
+ return MapPath (VirtualPath, BaseVirtualDir, true);
}
[MonoTODO("allowCrossAppMapping?")]
@@ -965,10 +975,11 @@ namespace System.Web { if (UrlUtils.IsRooted (virtualPath)) {
virtualPath = UrlUtils.Reduce (virtualPath);
} else {
- if (baseVirtualDir == null)
+ if (baseVirtualDir == null) {
virtualPath = UrlUtils.Combine (RootVirtualDir, virtualPath);
- else
+ } else {
virtualPath = UrlUtils.Combine (baseVirtualDir, virtualPath);
+ }
}
return _WorkerRequest.MapPath (virtualPath);
|