• last updated 16 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fix typo

implemented ad_html_security_check based on ns_parsehtml

Use "ns_parsehtml" for speed and correctness when available

The new NaviServer built-in command "ns_parsehtml" is used on

several occasions in the code when available, namely in

- util_close_html_tags

- escaping disallowed HTML tags in ad_text_to_html

- util_close_html_tags

The command "util_close_html_tags" has a long history of troubles,

since it was implemented originally based on regular expressions. It

was reported in Jan 2009, that the function took on certain forums

entries 6 to 9 hours (e.g. /forums/message-view?message_id=357753) to

finish. Therefore, at this time a quick version based on tdom was

introduced, which reduced at that time the performance to 7.3

seconds. However, the tdom-based version tend to fail on invalid HTML,

so it could cover only a few cases. The new "ns_parsehtml" is more

robust and works very stable on openacs.org with the know problem

cases. Furthermore, this version is also significantly faster than the

tdom version.

improve spelling

    • -10
    • +69
    ./test/html-conversion-procs.tcl
Fix typo

fix bug in db_multirow_group_last_row_p

The bug showed up in bug-tracker usage of multirows,

where db_multirow_group_last_row_p was still expecting the

dict structure

use icanuse "ns_parsehtml" and new interface

added icanuse rule for ns_parsehtml

Give people the chance to use OpenACS with WithDeprecatedCode set to 0

When OpenACS is configured with loading of deprecated procs

deactivated, files like deprecated-procs.tcl are not

loaded. Therefore, these files should only contain code, which was

deprecated at LEAST ONE RELEASE EARLIER, such that site admins have one

release time to fix calls to deprecated code.

This change reverts in part Antonio's commit from 26 Aug 2022 which

causes errors like the following on openacs.org:

Error in include template "/var/www/openacs.org/packages/news/lib/news":

invalid command name "ad_parameter_all_values_as_list"

Deprecate ad_parameter_all_values_as_list: it does not provide much value and was also often use improperly

tmpfile page contract filter reform:

do not allow acs-subsite TmpDir parameter to define where the tmpfolder is located anymore. This MUST be the one configured in the server-wide configuration. Tmpfiles cannot be in a subfolder of the tmpfolder, they MUST be direct children instead. A tmpfile MUST exist beforehand and be owned, be readable and writable by the user running the nsd process. This complies with the definition of a tmpfile by AolServer/NaviServer when they are created to store content coming from a file upload.

  1. … 2 more files in changeset.
Extend tmpfile filter to behave in the "old way" (default), or in strict mode e.g. tmpfile(strict), enforcing the behavior for tmpfile in Aolserver/Naviserver when a form is processed

Reimplement ad_page_contract_filter_proc_tmpfile using security::safe_tmpfile_p

Some of the features implemented by this filter have been ported into the api, namely the possibility to fetch the valid temp folders from the subsite TmpDir parameter and the possibility to relax the check and allow also files deeper in the tmpfolder hierachy.

Notably, the hardcoded tmpfolders "/var/tmp" and "/tmp" have NOT been ported. One should configure these values via the many available options. security::safe_tmpfile_p is also more restrictive when a file exists, because it checks for ownership and read and write permissions on the file.

Comment WIP

Declare proc coverage

  1. … 1 more file in changeset.
Factor the payload building behavior in util::http::post into its own proc, so that it can be reused elsewhere

Add must_exist flag to enforce a safe tmpfile to already exist

  1. … 1 more file in changeset.
Fixed bug in util_convert_line_breaks_to_html

The code deleted spaces around certain tags, while - according to the

documentation, only line breaks should be removed from there.

Extended regression test.

Introduce security::safe_tmpfile_p checking whether a file belongs to the configured tmpfolder and respects other constraints

The plan is to use it to improve input validations

  1. … 1 more file in changeset.
Deactivated script-dynamic again

activating "script-dynamic" for script-src prevents resources as the following from loading

<script type="text/javascript" src="/resources/xowiki/bootstrap-treeview/1.2.0/bootstrap-treeview.min.js" nonce="F8843D5CD542FB1CDB4C94C5D13C4E5ECC2E1DCA">

improve test coverage of apm_* API

added test for checking documentation in regard of valid HTML markup

Properly escape "<" and ">" in api-doc documentation.

Since all documentation is rendered via HTML, the characters

"<" and ">" have to be HTML-quoted, otherwise strange things

(omission, unintended renderings) might occur.

E.g. the sentence

Define an interface between a page and an

ADP <include> similar to the page_contract.

was rendered as

Define an interface between a page and an

ADP similar to the page_contract.

which is incorrect.

  1. … 10 more files in changeset.
Changed "db_multirow" to use "db_list_of_lists" instead of "db_list_of_ns_sets"

Thanks to the recent improvements in NaviServer for

"db_list_of_lists", it is more efficient to use this in "db_multirow"

(actually in "db_multirow_helper"). The implementation revealed a bug

in "db_list_of_lists", when both options "-columns_var" and

"-with_headers" were set.

Extended regression test to cover the former bug.

Relax tdom tolerance for non-standard markup

Test apm_get_repository_channels proc

file apm-install-procs.tcl was initially added on branch oacs-5-10.

    • -0
    • +0
    ./test/apm-install-procs.tcl
Fix typo

Generalized "version_dir" handling a little for download specs

The problem was that bootstrap5 uses a version directory, which

consists of the version plus an extra string element. The previous

version assumed that the version is always used as a directory name.

Whe track now the versionDir information in the resource_info dict and

use this, when available (otherwise the version number is used as before).

The resource_info dict contains now the following path components:

# Provide paths for loading either via /resources/ or CDN

#

# "resourceDir" is the absolute path in the filesystem

# "resourceUrl" is the URL path provided to the request processor

# "versionDir" is the version-specific element both in the

# URL and in the filesystem.

#

bumped acs-tcl to 5.10.1d19

  1. … 2 more files in changeset.
fix several bugs in "acs_object_type::supertype" and improve code sanity