Skip to content

[stable33] Fix handling of "enableScripting" data attribute#1398

Draft
backportbot[bot] wants to merge 3 commits intostable33from
backport/1396/stable33
Draft

[stable33] Fix handling of "enableScripting" data attribute#1398
backportbot[bot] wants to merge 3 commits intostable33from
backport/1396/stable33

Conversation

@backportbot
Copy link
Copy Markdown

@backportbot backportbot bot commented Mar 25, 2026

Backport of #1396

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Remove all the empty commits

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

danxuliu and others added 3 commits March 25, 2026 20:38
In PHP, a boolean is converted to a string as either "1" or "" rather
than to "true" or "false". Moreover, the value of the data attribute is
always returned as a string in JavaScript, so it never matched a strict
comparison against a boolean value.

It would be possible to fix this by comparing against "1" in Javascript.
However, for clarity (and given that semantically an existing data
attribute would be considered a boolean true if present, even if empty),
now the "enableScripting" data attribute is explicitly set to either
"true" or "false" and the comparison in JavaScript is done against a
string "true".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants