Skip to content

Commit

Permalink
Updating the GitHub repo with the latest changes from the 9.5 branch.
Browse files Browse the repository at this point in the history
This release is a bugfix release; with fixes for the page caching system, some fixes for
quality of life features when for logging in as an admin, and some miscellaneous fixes in
admin mode.

Security related fixes
----------------------

We're removed the "Tree Explorer" tool from Organizer, as this was no longer supported and
the code contained a XSS vulnerability.

Fixes in visitor mode
---------------------

 * Fixed a bug with the page caching system, where if you have a document download plugin
   in a nest, which links to a document that's still a first draft, it would crash in
   visitor mode with a PHP fatal error.

Fixes for logging in as an admin
--------------------------------

 * Fixed a bug where the admin login screen would not correctly redirect an administrator
   back to the content item they were previously on, if the page they were previously on
   was served from the page cache.
 * Fixed a bug where the admin login screen would not correctly redirect an administrator
   back to the content item they were previously on, if the administrator had just clicked
   the "AUTHENTICATE" button in the email with their 2FA code.

Fixes in admin mode
-------------------

 * Fixed a bug where the "Save and Next" button for content items was not working for
   content items that did not already have a draft created.
  • Loading branch information
Chris Turnbull committed Feb 27, 2024
1 parent 72afb59 commit 121ff6d
Show file tree
Hide file tree
Showing 26 changed files with 43 additions and 10,391 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
"wow.js": "^1.2.2",
"zxcvbn": "^4.4.2"
},
"version": "9.5.60437"
"version": "9.5.60602"
}
2 changes: 1 addition & 1 deletion zenario/admin/db_updates/latest_revision_no.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
define('ZENARIO_MINOR_VERSION', '5');
define('ZENARIO_CHANGELOG_URL', 'https://zenar.io/zenario-95');
define('ZENARIO_IS_BUILD', true);
define('ZENARIO_REVISION', '60437');
define('ZENARIO_REVISION', '60602');

define('TINYMCE_DIR', 'zenario/libs/manually_maintained/lgpl/tinymce_4_7_3.1/');
52 changes: 0 additions & 52 deletions zenario/admin/tree_explorer/includes/json.php

This file was deleted.

58 changes: 0 additions & 58 deletions zenario/admin/tree_explorer/includes/tree_explorer.fun.php

This file was deleted.

60 changes: 0 additions & 60 deletions zenario/admin/tree_explorer/includes/tree_explorer.php

This file was deleted.

57 changes: 0 additions & 57 deletions zenario/admin/tree_explorer/index.php

This file was deleted.

8 changes: 7 additions & 1 deletion zenario/autoload/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,12 @@ public static function postSlot($slotName, $showPlaceholderMethod, $useOb = true
$setFiles = [];
foreach ($eggsToCache as $slotNameNestId => &$cacheVars) {
$slot = \ze::$slotContents[$slotNameNestId];
$eggInstance = $slot->class();

//Don't try and check the cache for a nested plugin that refused to load.
if (is_null($eggInstance)) {
continue;
}

//Loop through this slot and any child slots, coming up with the rules as to when we should clear the cache
//For nests with child slots, we should combine the rules
Expand All @@ -964,7 +970,7 @@ public static function postSlot($slotName, $showPlaceholderMethod, $useOb = true
}
}

$cacheVars['c'] = $slot->class()->zAPIGetCachableVars();
$cacheVars['c'] = $eggInstance->zAPIGetCachableVars();

$temps[$slotNameNestId] = $slot->trimVarsBeforeCaching();
$cacheVars['s'] = $slot;
Expand Down
4 changes: 3 additions & 1 deletion zenario/autoload/welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -4615,8 +4615,10 @@ public static function congratulationsAJAX(&$source, &$tags, &$fields, &$values,
//Formerly "redirectAdmin()"
public static function redirectAdmin($getRequest, $forceAliasInAdminMode = false, $continueTo = 'default') {

//If the visitor's original request was from a content item, try to use that as the destination.
$cID = $cType = $redirectNeeded = $aliasInURL = $langIdInURL = false;
if (!empty($getRequest)) {
if (!empty($getRequest)
&& !(empty($getRequest['cID']) && empty($getRequest['cType']) && empty($getRequest['langId']))) {
\ze\content::resolveFromRequest($cID, $cType, $redirectNeeded, $aliasInURL, $langIdInURL, $getRequest, $getRequest, []);
}

Expand Down
2 changes: 1 addition & 1 deletion zenario/basicheader.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ public static function cacheFriendlyCookieVar($var) {
|| substr($var, 0, 4) == '_ga_'
|| substr($var, 0, 9) == 'PHPSESSID'
|| substr($var, 0, 11) == 'can_cache__'
|| in_array($var, ['cookies_accepted', '_ga', '_gat', 'is_returning']);
|| in_array($var, ['cookies_accepted', '_ga', '_gat', '_fbp', '_clck', '_uetvid', 'is_returning', 'COOKIE_LAST_ADMIN_USER', 'COOKIE_LAST_ADMIN_CAPTCHA_COMPLETED', 'ZENARIO_ADMIN_LOGIN_LINK']);
}

//Returns true if a $_SESSION variable does not affect caching (or is already covered by another existing category)
Expand Down
12 changes: 12 additions & 0 deletions zenario/includes/index.pre_load.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,18 @@ function zenarioPageCacheLogStats($stats) {

zenarioPageCacheLogStats(['hits', 'total']);
touch($chPath. 'accessed');


//Try and record the destCID and destCType as we would a normal page view
if ($tagId = file_get_contents($chPath. 'tag_id')) {
$tag = explode('_', $tagId, 2);
if (isset($tag[1])) {
if ($cID = (int) $tag[1]) {
$_SESSION['destCID'] = $cID;
$_SESSION['destCType'] = $tag[0];
}
}
}


//If there are cached images on this page, mark that they've been accessed
Expand Down
2 changes: 1 addition & 1 deletion zenario/js/admin_box_toolkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ methods.showConfirm = function(saveAndContinue, createAnother, saveAndNext) {
}

var buttons =
'<input type="button" class="submit_selected" value="' + thus.tuix.confirm.button_message + '" onclick="' + thus.globalName + '.save(true, ' + engToBoolean(saveAndContinue) + ', ' + engToBoolean(createAnother) + ');"/>' +
'<input type="button" class="submit_selected" value="' + thus.tuix.confirm.button_message + '" onclick="' + thus.globalName + '.save(true, ' + engToBoolean(saveAndContinue) + ', ' + engToBoolean(createAnother) + ', ' + engToBoolean(saveAndNext) + ');"/>' +
'<input type="button" class="submit" value="' + (thus.tuix.confirm.cancel_button_message || zenarioA.phrase.cancel) + '"/>';

zenarioA.floatingBox(message, buttons, thus.tuix.confirm.message_type || 'none');
Expand Down

0 comments on commit 121ff6d

Please sign in to comment.