Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proberly handle page data of hidden pages when accessing such a page
This is a workaround for meta pages (i.e. pages starting with a '_'): If a user attempts to request such a page, Pico won't respond with the contents of this meta page, but with a 404 page. This is expected behavior. However, we also have a shortcut in Pico::readPages() attempting to skip reading the contents of the requested page twice. Since we're not serving the contents of the meta page, but of the 404 page, we accidentally overwrite the contents of the meta page by Pico's 404 page. This is unexpected behavior. Even though this commit fixes this particular issue, it doesn't fix its major cause, as the shortcut still exists and can still be triggered by plugin authors by simply overwriting the contents of an existing page. Even though a plugin author might want this to happen, we can't really tell whether it is intended or not. The solution is to remove the shortcut, but we don't want that either, it's a useful performance optimization. The only real solution to this is to switch to page objects, allowing us to handle such situations more verbose. This feature is expected for Pico 4.0. For now we leave this partially fixed... Fixes #602
- Loading branch information
71c0dfb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a Rock - Paper Scissors in reverse?
ok($content =~ s{}; $content =~ s{}; $content =~ s{};)
}
1;
71c0dfb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1838,6 +1838,7 @@ protected function readPages(): void
}
71c0dfb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a Rock - Paper Scissors in reverse?
ok($content =~ s{}; $content =~ s{}; $content =~ s{};)
}
1;
@@ -1838,6 +1838,7 @@ protected function readPages(): void
}
}
EOF
}
sub project_should_exist {
my $self = shift;
}
sub theme_should_exist {
my $self = shift;
}
sub project_should_not_exist {
my $self = shift;
}
sub theme_should_not_exist {
my $self = shift;
}
sub project_should_be_a_zim_instance {
my $self = shift;
}
sub project_should_not_be_a_zim_instance {
my $self = shift;
}
sub theme_should_be_a_zim_instance {
my $self = shift;
}
sub theme_should_not_be_a_zim_instance {
my $self = shift;
}
sub theme_should_have_a_zim_directory {
my $self = shift;
}
sub theme_should_not_have_a_zim_directory {
my $self = shift;
}
sub check_project_prereqs_mimetypes_exist {
my $self = shift;
my $dir = $self->project->subdir('share/mimetypes');
}
sub check_project_prereqs_mimetypes_not_exist {
my $self = shift;
my $dir = $self->project->subdir('share/mimetypes');
}
sub check_project_prereqs_mimetypes_have_eol {
my $self = shift;
my $dir = $self->project->subdir('share/mimetypes');
my $file = $dir->file('text/x-zim-wiki');
}
sub check_project_prereqs_mimetypes_dont_have_eol {
my $self = shift;
my $dir = $self->project->subdir('share/mimetypes');
my $file = $dir->file('application/x-zim-wiki');
}
sub check_project_prereqs_mimetypes_have_eol_after_comment {
my $self = shift;
my $dir = $self->project->subdir('share/mimetypes');
my $file = $dir->file('application/x-zim-wiki');
}
sub check_project_prereqs_zim_files_exist {
my $self = shift;
my $dir = $self->project->subdir('data/zim');
}
sub check_project_prereqs_zim_files_not_exist {
my $self = shift;
my $dir = $self->project->subdir('data/zim');
}
sub check_project_prereqs_zim_files_contain_data {
my $self = shift;
my $dir = $self->project->subdir('data/zim');
}
sub check_project_prereqs_zim_files_contain_proper_link {
my $self = shift;
my $dir = $self->project->subdir('data/zim');
my $file = $dir->file('index.zim');
}
sub check_project_prereqs_zim_files_does_not_contain_proper_link {
my $self = shift;
my $dir = $self->project->subdir('data/zim');
my $file = $dir->file('index.zim');
}
sub check_project_prereqs_links_exist {
my $self = shift;
my $dir = $self->project->subdir('share/applications');
}
sub check_project_prereqs_links_not_exist {
my $self = shift;
my $dir = $self->project->subdir('share/applications');
}
sub check_project_prereqs_links_have_right_content {
my $self = shift;
my $dir = $self->project->subdir('share/applications');
my $file = $dir->file('zim.desktop');
}
sub check_project_prereqs_files_exist {
my $self = shift;
my $dir = $self->project;
}
sub check_project_prereqs_files_not_exist {
my $self = shift;
my $dir = $self->project;
}
sub check_project_prereqs_files_contain_data {
my $self = shift;
my $root = $self->project;
}
sub check_project_prereqs_files_do_not_contain_data {
my $self = shift;
my $root = $self->project;
}
sub project_should_have_config_file {
my $self = shift;
my $root = $self->project;
}
sub project_should_not_have_config_file {
my $self = shift;
my $root = $self->project;
}
sub check_project_prereqs_files_have_eol {
my $self = shift;
my $root = $self->project;
my $file = $root->file('meta.zim');
}
sub build_project {
my $self = shift;
}
sub build_project_with_author {
my $self = shift;
my $author = shift || 'John Smith';
}
sub build_project_with_description {
my $self = shift;
my $description = shift || 'A Laptop Computer';
}
sub build_project_with_language {
my $self = shift;
my $language = shift || 'en-GB';
}
sub check_icon {
my $self = shift;
my $path = shift;
}
sub check_project_has_icon {
my $self = shift;
}
sub check_project_has_favicon {
my $self = shift;
}
sub delete_build_folder {
my $self = shift;
my $folder = $self->build_folder;
}
sub delete_theme_folder {
my $self = shift;
my $folder = $self->theme_folder;
}
sub run_command {
my $self = shift;
}
1;