Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
Fixed Github issue #3 - page hanging when parameter contains single quote.
  • Loading branch information
markdomansky committed May 28, 2018
2 parents 10904a5 + e36ac9d commit 680d867
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 19 deletions.
4 changes: 2 additions & 2 deletions WebJEA/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("0.9.131.18141")>
<Assembly: AssemblyFileVersion("0.9.126.18141")>
<Assembly: AssemblyVersion("0.9.144.18148")>
<Assembly: AssemblyFileVersion("0.9.144.18148")>
48 changes: 33 additions & 15 deletions WebJEA/PSScriptParser.vb
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,35 @@ Public Class PSScriptParser

Dim startIDX As Integer = prvScript.IndexOf("<#")
Dim endIDX As Integer = prvScript.IndexOf(vbLf & "#>")
Dim dividerIDX As Integer
Dim dividerIDX2 As Integer

dividerIDX = prvScript.IndexOf(vbLf & ".", startIDX)
While Not (dividerIDX = -1 Or dividerIDX2 >= endIDX)
'find the next entry in the comment block, or if non exists (or > then endidx), set to endidx
dividerIDX2 = prvScript.IndexOf(vbLf & ".", dividerIDX + 1)
If dividerIDX2 = -1 Or dividerIDX2 > endIDX Then
dividerIDX2 = endIDX
End If
'Dim dividerIDX As Integer
'Dim dividerIDX2 As Integer
Dim commentBlock As String

Dim section As String = prvScript.Substring(dividerIDX + 1, dividerIDX2 - dividerIDX) 'the +1 and -2 account for the vblf
ParseCommentBlockSection(section)
If (startIDX = -1 Or endIDX = -1) Then
'comment block isn't valid, can't do anything with it.
Return
End If

dividerIDX = dividerIDX2
End While
commentBlock = prvScript.Substring(startIDX, endIDX - startIDX)
Dim cbSet As String() = Regex.Split(commentBlock, "(?=\n\.)")

For Each cbItem In cbSet
ParseCommentBlockSection(cbItem.Trim())
Next

'dividerIDX = prvScript.IndexOf(vbLf & ".", startIDX)
'While Not (dividerIDX = -1 Or dividerIDX2 >= endIDX)
' 'find the next entry in the comment block, or if non exists (or > then endidx), set to endidx
' dividerIDX2 = prvScript.IndexOf(vbLf & ".", dividerIDX + 1)
' If dividerIDX2 = -1 Or dividerIDX2 > endIDX Then
' dividerIDX2 = endIDX
' End If

' Dim section As String = prvScript.Substring(dividerIDX + 1, dividerIDX2 - dividerIDX) 'the +1 and -2 account for the vblf
' ParseCommentBlockSection(section)

' dividerIDX = dividerIDX2
'End While

'copy Parameter help to psparams

Expand Down Expand Up @@ -171,7 +184,12 @@ Public Class PSScriptParser
Dim commentIDX As Integer = prvScript.IndexOf("<#")
If commentIDX > -1 Then
'found a comment block that MIGHT have 'param' in it
IDX = AdvIndexOf(prvScript, New List(Of String)({"#>"}), commentIDX)

IDX = prvScript.IndexOf("#>", commentIDX)
If IDX = -1 Then
dlog.Error("ScriptParser: Did not find end of comment block")
End If
IDX += 2 'skip the #>
dlog.Trace("ScriptParsers: ParseParameters: Found Comment Block " & commentIDX.ToString & " to " & IDX.ToString)
End If

Expand Down
9 changes: 7 additions & 2 deletions WebJEA/WebJEA.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2018
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WebJEA", "WebJEA.vbproj", "{0327F3B9-9BEA-4F00-86A5-C7355A1FC5D0}"
EndProject
Expand All @@ -21,4 +21,9 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
BuildVersion_UseGlobalSettings = True
BuildVersion_StartDate = 2000/1/1
SolutionGuid = {6AC2BC8A-23E5-4208-A7BD-C7BBA12AE5E9}
EndGlobalSection
EndGlobal
9 changes: 9 additions & 0 deletions WebJEA/WebJEA.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@
<RunCodeAnalysis>false</RunCodeAnalysis>
<CodeAnalysisIgnoreGeneratedCode>true</CodeAnalysisIgnoreGeneratedCode>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<ShouldCreateLogs>True</ShouldCreateLogs>
<AdvancedSettingsExpanded>False</AdvancedSettingsExpanded>
<UpdateAssemblyVersion>False</UpdateAssemblyVersion>
<UpdateAssemblyFileVersion>False</UpdateAssemblyFileVersion>
<UpdateAssemblyInfoVersion>False</UpdateAssemblyInfoVersion>
<UpdatePackageVersion>False</UpdatePackageVersion>
<AssemblyInfoVersionType>SettingsVersion</AssemblyInfoVersionType>
<InheritWinAppVersionFrom>None</InheritWinAppVersionFrom>
</PropertyGroup>
<ItemGroup>
<Reference Include="AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604, processorArchitecture=MSIL">
Expand Down Expand Up @@ -441,6 +449,7 @@
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
<UserProperties BuildVersion_UseGlobalSettings="True" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
<PropertyGroup>
Expand Down

0 comments on commit 680d867

Please sign in to comment.