From c72938e207f71a44f0661a1e0c335123f3f404e4 Mon Sep 17 00:00:00 2001 From: kirinji Date: Wed, 19 Sep 2007 19:06:32 +0000 Subject: [PATCH] More updates. --- cgi-files/Modules/Database/MySQL5.pm | 2 ++ cgi-files/Modules/Database/SQLite.pm | 12 ++++++++++-- cgi-files/install.cgi | 6 +++++- cgi-files/kiriwrite.cgi | 15 ++++++++------- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/cgi-files/Modules/Database/MySQL5.pm b/cgi-files/Modules/Database/MySQL5.pm index 3a41408..945704a 100644 --- a/cgi-files/Modules/Database/MySQL5.pm +++ b/cgi-files/Modules/Database/MySQL5.pm @@ -1833,6 +1833,8 @@ sub editpage{ # Check if there is a page that already exists with the new # filename. + $page_found = 0; + if ($page_filename ne $page_newfilename){ $string_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_newfilename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return ); diff --git a/cgi-files/Modules/Database/SQLite.pm b/cgi-files/Modules/Database/SQLite.pm index 28c7cba..72ae6a5 100644 --- a/cgi-files/Modules/Database/SQLite.pm +++ b/cgi-files/Modules/Database/SQLite.pm @@ -605,11 +605,11 @@ sub getdblist{ foreach $database (@data_directory){ - $database =~ s/.db.sqlite$//g; + $database =~ s/.db.sqlite$//og; $database_filename_friendly = $database; #$database_filename_length = length($database); - #$database_filename_friendly = substr($database, 0, $database_filename_length - 3); + #$database_filename_friendly = substr($database, 0, $database_filename_length - 10); push(@data_directory_final, $database_filename_friendly); } @@ -1204,6 +1204,12 @@ sub getpageinfo{ my $page_filename = $passedoptions->{"PageFilename"}; my $page_reduced = $passedoptions->{"Reduced"}; + if (!$page_reduced){ + + $page_reduced = 0; + + } + if ($page_reduced eq 1){ $string_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, lastmodified FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return ); @@ -1524,6 +1530,8 @@ sub editpage{ # Check if there is a page that already exists with the new # filename. + $page_found = 0; + if ($page_filename ne $page_newfilename){ $string_handle = $database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_newfilename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return ); diff --git a/cgi-files/install.cgi b/cgi-files/install.cgi index 0bb18dc..22a08aa 100755 --- a/cgi-files/install.cgi +++ b/cgi-files/install.cgi @@ -26,7 +26,7 @@ use warnings; # Write warnings to the HTTP Server Log file. use utf8; use CGI qw(:standard *table *Tr *td); -use CGI::Carp('fatalsToBrowser'); # Output errors to the browser. +#use CGI::Carp('fatalsToBrowser'); # Output errors to the browser. # Setup strings in specific languages. Style should be no spacing for # language title and one tabbed spacing for each string. @@ -1597,6 +1597,10 @@ $test_list{CheckXMLSimple}{Name} = "XML::Simple"; $test_list{CheckXMLSimple}{Type} = "dependency"; $test_list{CheckXMLSimple}{Code} = "XML::Simple"; +$test_list{CheckXMLParser}{Name} = "XML::Parser"; +$test_list{CheckXMLParser}{Type} = "dependency"; +$test_list{CheckXMLParser}{Code} = "XML::Parser"; + $test_list{CheckTieHash}{Name} = "Tie::IxHash"; $test_list{CheckTieHash}{Type} = "dependency"; $test_list{CheckTieHash}{Code} = "Tie::IxHash"; diff --git a/cgi-files/kiriwrite.cgi b/cgi-files/kiriwrite.cgi index bd59725..160f0d1 100755 --- a/cgi-files/kiriwrite.cgi +++ b/cgi-files/kiriwrite.cgi @@ -26,12 +26,15 @@ use warnings; # Write warnings to the HTTP Server Log file. 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. @@ -75,6 +78,8 @@ sub BEGIN{ "script_filename" => $script_filename, ); + $ENV{XML_SIMPLE_PREFERRED_PARSER} = "XML::Parser"; + } ################################################################################# @@ -10309,10 +10314,6 @@ sub kiriwrite_settings_edit{ 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 @@ -11300,7 +11301,7 @@ sub kiriwrite_settings_load{ # 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. -- 2.39.2