fix some longstanding bugs and stamp out deprecation warnings

This commit is contained in:
Michael Becker 2025-12-04 19:17:31 -05:00
parent abcf832f47
commit 4bb5738075
3 changed files with 80 additions and 56 deletions

View File

@ -323,10 +323,10 @@
$this->resParser = \xml_parser_create ();
\xml_parser_set_option($this->resParser, XML_OPTION_CASE_FOLDING, 0);
\xml_set_object($this->resParser, $this);
\xml_set_element_handler($this->resParser, "tagOpen", "tagClosed");
// \xml_set_object($this->resParser, $this);
\xml_set_element_handler($this->resParser, $this->tagOpen(...), $this->tagClosed(...));
\xml_set_character_data_handler($this->resParser, "tagData");
\xml_set_character_data_handler($this->resParser, $this->tagData(...));
$this->strXmlData = \xml_parse($this->resParser, $input);
if(!$this->strXmlData)
@ -336,7 +336,9 @@
die(sprintf("XML error: %s at line %d", $message, $lineNumber));
}
if (PHP_VERSION_ID < 80000) {
\xml_parser_free($this->resParser);
}
return MarkupObjectModel::FromArray($this->mvarOutput);
}

View File

@ -621,7 +621,7 @@
return $_GET["virtualpath"];
}
}
return null;
return "";
}
public static function IncludeFile($filename, $isRequired)
{
@ -882,6 +882,17 @@
*/
public static function ParsePathVariables(string $template, string $pathstr)
{
if ($pathstr == "")
{
if ($template == "")
{
return [ ];
}
else
{
return false;
}
}
$l = strlen($template);
$i = 0;
@ -1056,9 +1067,11 @@
}
$path = System::GetVirtualPath();
if (System::$Configuration["Runtime.DisableAutomaticExtensionParsing"] !== true)
if (System::GetConfigurationValue("Runtime.DisableAutomaticExtensionParsing") !== true)
{
// strip path extension if there is one
if (count($path) > 0)
{
$pathLast = $path[count($path) - 1];
$ix = strripos($pathLast, ".");
if ($ix !== false)
@ -1100,6 +1113,7 @@
}
}
}
}
$success = false;
@ -1138,7 +1152,7 @@
if (!$success)
{
$retval = call_user_func(System::$ErrorEventHandler, new ErrorEventArgs("The specified resource is not available on this server. (" . (System::$EnableTenantedHosting ? ("Tenanted - " . System::GetTenantName()) : "Non-Tenanted") . ")<br />Path: " . $_GET["virtualpath"]));
$retval = call_user_func(System::$ErrorEventHandler, new ErrorEventArgs("The specified resource is not available on this server. (" . (System::$EnableTenantedHosting ? ("Tenanted - " . System::GetTenantName()) : "Non-Tenanted") . ")<br />Path: " . (isset($_GET["virtualpath"]) ? $_GET["virtualpath"] : "")));
return false;
}
return true;

View File

@ -59,6 +59,8 @@
{
$path = System::GetVirtualPath();
// strip path extension if there is one
if (count($path) > 0)
{
$pathLast = $path[count($path) - 1];
$ix = strripos($pathLast, ".");
if ($ix !== false)
@ -66,6 +68,7 @@
$pathExt = substr($pathLast, $ix + 1);
$path[count($path) - 1] = substr($pathLast, 0, $ix);
}
}
return System::ExpandRelativePath("~/" . implode("/", $path));
}
@ -557,10 +560,10 @@
}
$initializingEventArgs = new CancelEventArgs();
$initializingEventArgs->RenderingPage = $renderingPage;
// $initializingEventArgs->RenderingPage = $renderingPage;
$initializedEventArgs = new EventArgs();
$initializedEventArgs->RenderingPage = $renderingPage;
// $initializedEventArgs->RenderingPage = $renderingPage;
if (method_exists($this, "OnInitializing"))
{
@ -941,11 +944,14 @@
if ($e->Cancel)
return;
if ($this->ClassReference != null)
{
if (method_exists($this->ClassReference, "OnPreRender"))
{
$retval = $this->ClassReference->OnPreRender($e);
if ($e->Cancel) return;
}
}
$handled = false;
@ -1300,7 +1306,8 @@
}
}
if ($this->ClassReference != null)
{
if (method_exists($this->ClassReference, "RenderContents"))
{
ob_start();
@ -1308,6 +1315,7 @@
$tagBODY->Content = ob_get_contents();
ob_end_clean();
}
}
$tagHTML->Controls[] = $tagBODY;
$tagHTML->Render();