From ae7ec57550d2ef5f947954c6cc4e06b4e27769b1 Mon Sep 17 00:00:00 2001 From: kirinji Date: Sun, 5 Aug 2007 21:29:09 +0000 Subject: [PATCH] Some minor alterations made. --- cgi-files/Modules/Database/MySQL5.pm | 4 ++-- cgi-files/Modules/Database/SQLite.pm | 2 +- cgi-files/kiriwrite.cgi | 27 +++++++++++++++++---------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/cgi-files/Modules/Database/MySQL5.pm b/cgi-files/Modules/Database/MySQL5.pm index d04430f..18fe539 100644 --- a/cgi-files/Modules/Database/MySQL5.pm +++ b/cgi-files/Modules/Database/MySQL5.pm @@ -21,13 +21,13 @@ # Define the package (perl module) name. -package Kiriwrite::Database::MySQL; +package Kiriwrite::Database::MySQL5; # Enable strict and use warnings. use strict; use warnings; -use Encode; +use Encode qw(); # Load the following Perl modules. diff --git a/cgi-files/Modules/Database/SQLite.pm b/cgi-files/Modules/Database/SQLite.pm index f179a62..92bce19 100644 --- a/cgi-files/Modules/Database/SQLite.pm +++ b/cgi-files/Modules/Database/SQLite.pm @@ -30,7 +30,7 @@ use warnings; # Load the following Perl modules. -use DBI; +use DBI qw(); # Set the following values. diff --git a/cgi-files/kiriwrite.cgi b/cgi-files/kiriwrite.cgi index 74c1671..bb13b10 100755 --- a/cgi-files/kiriwrite.cgi +++ b/cgi-files/kiriwrite.cgi @@ -24,10 +24,10 @@ use strict; # Throw errors if there's something wrong. use warnings; # Write warnings to the HTTP Server Log file. -use utf8; -use CGI qw(:standard); +use utf8 qw(); +use CGI qw(header); use CGI::Carp('fatalsToBrowser'); # Output errors to the browser. -use Tie::IxHash; +use Tie::IxHash qw(); # Declare global variables for Kiriwrite settings and languages. @@ -8809,6 +8809,11 @@ sub kiriwrite_compile_makepages{ if ($page_content){ $page_final = $templatefiles{$page_template}{template}; + + if (!$page_final){ + $page_final = ""; + } + $page_final =~ s//$page_content/g; } @@ -8998,6 +9003,13 @@ sub kiriwrite_compile_makepages{ ($page_filename) = $page_filename =~ m/^(.*)$/g; ($kiriwrite_config{"directory_data_output"}) = $kiriwrite_config{"directory_data_output"} =~ m/^(.*)$/g; open($filehandle_page, ">:utf8 ", $kiriwrite_config{"directory_data_output"} . '/' . $page_filename) or ($kiriwrite_presmodule->addtext($error_prefix . kiriwrite_language($kiriwrite_lang->{compile}->{pagenotwritten}, $page_filename, $!)), $kiriwrite_presmodule->addlinebreak(), $error_count++, next); + + if (!$page_final){ + + $page_final = ""; + + } + binmode $filehandle_page, ':utf8'; print $filehandle_page $page_final; close($filehandle_page); @@ -11260,7 +11272,7 @@ sub kiriwrite_settings_load{ # Load the required Perl modules. - use XML::Simple; + use XML::Simple qw(XMLin); my $xsl = XML::Simple->new(); # Check if the Kiriwrite configuration file exists before using it and @@ -13096,7 +13108,7 @@ sub kiriwrite_utf8convert{ # Load the Encode perl module. - use Encode; + use Encode qw(decode_utf8); # Convert the string. @@ -13501,11 +13513,6 @@ if ($query->param('mode')){ if ($http_query_confirm eq 1){ # Value is correct, collect the variables to pass onto the database variable. - # Load the XML::Simple module. - - use XML::Simple; - my $xsl = XML::Simple->new(); - # Get the variables from the HTTP query. my $newdatabasename = $query->param('databasename'); -- 2.39.2