use utf8;
use CGI qw(header);
-use CGI::Carp('fatalsToBrowser'); # Output errors to the browser.
use Tie::IxHash;
+# This is commented out because it uses a fair bit of CPU usage.
+
+#use CGI::Carp('fatalsToBrowser'); # Output errors to the browser.
+
# Declare global variables for Kiriwrite settings and languages.
-my ($kiriwrite_config, %kiriwrite_config, $kiriwrite_lang, $kiriwrite_version, %kiriwrite_version, $kiriwrite_env, %kiriwrite_env, $kiriwrite_presmodule, $kiriwrite_dbmodule);
+my ($kiriwrite_config, %kiriwrite_config, $kiriwrite_lang, $kiriwrite_version, %kiriwrite_version, $kiriwrite_env, %kiriwrite_env, $kiriwrite_presmodule, $kiriwrite_dbmodule, $xsl);
# Setup the version information for Kiriwrite.
"script_filename" => $script_filename,
);
+ $ENV{XML_SIMPLE_PREFERRED_PARSER} = "XML::Parser";
+
}
#################################################################################
my @newdatabase_page;
my $filename;
- my $filename_sql;
- my $filename_out;
- my $olddatabase_database_handle;
- my $olddatabase_string_handle;
my $olddatabase_name;
- my $newdatabase_database_handle;
- my $newdatabase_string_handle;
my $newdatabase_name;
my $page;
my $warning;
my $page_filename;
- my $page_filename_sql;
my $page_name;
- my $page_name_sql;
my $page_description;
- my $page_description_sql;
my $page_section;
- my $page_section_sql;
my $page_template;
- my $page_template_sql;
my $page_data;
- my $page_data_sql;
my $page_settings;
- my $page_settings_sql;
my $page_lastmodified;
- my $page_lastmodified_sql;
my $page_seek = 0;
my $warning_count = 0;
my $confirm = $passedoptions->{"Confirm"};
- # Load the required Perl modules.
-
- my $xsl = XML::Simple->new();
-
if (!$confirm){
# If the confirm value is blank, then set the confirm
# Load the required Perl modules.
use XML::Simple qw(XMLin);
- my $xsl = XML::Simple->new();
+ $xsl = XML::Simple->new();
# Check if the Kiriwrite configuration file exists before using it and
# return an critical error if it doesn't exist.
# Convert the password to make sure it can be read properly.
- $settings_database_password =~ s/\0//g;
- $settings_database_password =~ s/</</g;
- $settings_database_password =~ s/>/>/g;
+ if ($settings_database_password){
+
+ $settings_database_password =~ s/\0//g;
+ $settings_database_password =~ s/</</g;
+ $settings_database_password =~ s/>/>/g;
+
+ }
# Convert the less than and greater than characters are there and
# convert them.
- $settings_imagesuri =~ s/</</g;
- $settings_imagesuri =~ s/>/>/g;
+ if ($settings_imagesuri){
+
+ $settings_imagesuri =~ s/</</g;
+ $settings_imagesuri =~ s/>/>/g;
+
+ }
+
+ # Check if the database password value is undefined and if it is then
+ # set it blank.
+
+ if (!$settings_database_password){
+
+ $settings_database_password = "";
+
+ }
# Create the XML data layout.