Skip to content

Commit

Permalink
Backdrop 1.26.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shelane authored Oct 18, 2023
1 parent 796f90e commit 92f67a7
Show file tree
Hide file tree
Showing 234 changed files with 1,139 additions and 693 deletions.
2 changes: 1 addition & 1 deletion docroot/core/includes/bootstrap.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* The current system version.
*/
define('BACKDROP_VERSION', '1.26.0');
define('BACKDROP_VERSION', '1.26.1');

/**
* Core API compatibility.
Expand Down
11 changes: 10 additions & 1 deletion docroot/core/includes/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2913,7 +2913,16 @@ function l($text, $path, array $options = array()) {
$attributes = backdrop_attributes($options['attributes']);
unset($options['attributes']);

$url = check_plain(url($path, $options));
$url = url($path, $options);
$skip_js_paths = array(
'javascript:void()',
'javascript:void();',
'javascript:void(0)',
'javascript:void(0);',
);
if (!(is_null($path) || in_array(strtolower($path), $skip_js_paths))) {
$url = check_url($url);
}

// Sanitize the link text if necessary.
if (!$options['html']) {
Expand Down
137 changes: 123 additions & 14 deletions docroot/core/includes/filetransfer/filetransfer.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,76 @@
* root.
*/
abstract class FileTransfer {

/**
* The username for this file transfer.
*
* @var string
*/
protected $username;

/**
* The password for this file transfer.
*
* @var string
*/
protected $password;

/**
* The hostname for this file transfer.
*
* @var string
*/
protected $hostname = 'localhost';

/**
* The port for this file transfer.
*
* @var int
*/
protected $port;

/**
* Full path to directory where file-transfer is restricted to.
*
* @var string
*/
protected $jail;

/**
* @var string
* Path to connection chroot.
*
* @var string|false|null
*/
protected $chroot;
private $chrootPath;

/**
* The constructor for the UpdateConnection class. This method is also called
* from the classes that extend this class and override this method.
* The instantiated connection object.
*
* @var object|false|null
*/
private $connectionHandle;

/**
* The constructor for the FileTransfer class.
*
* This method is also called from the classes that extend this class and
* override this method.
*
* @param string $jail
* The full path where all file operations performed by this object will
* be restricted to. This prevents the FileTransfer classes from being
* able to touch other parts of the filesystem.
*/
function __construct($jail) {
$this->jail = $jail;
}

/**
* Defines a factory method for this class.
*
* Classes that extend this class must override the factory() static method.
* They should return a new instance of the appropriate FileTransfer subclass.
*
* @param string $jail
* The full path where all file operations performed by this object will
Expand All @@ -46,7 +91,7 @@ abstract class FileTransfer {
* getSettingsForm() method uses any nested settings, the same structure
* will be assumed here.
*
* @return FileTransfer
* @return object
* New instance of the appropriate FileTransfer subclass.
*
* @throws FileTransferException
Expand All @@ -61,19 +106,72 @@ abstract class FileTransfer {
* If the connection isn't set to anything, this will call the connect() method
* and set it to and return the result; afterwards, the connection will be
* returned directly without using this method.
*
* @param string $name
* The name of the variable to return.
*
* @return string|bool
* The variable specified in $name.
*/
function __get($name) {
if ($name == 'connection') {
$this->connect();
return $this->connection;
return $this->connectionHandle;
}

if ($name == 'chroot') {
$this->setChroot();
return $this->chroot;
return $this->chrootPath;
}
}

/**
* Implementation of the magic __set() method.
*
* @param string $name
* The name of the variable to set.
*
* @param string|object|false|null $value
* The value to be assigned to the variable.
*/
public function __set($name, $value) {
if ($name == 'connection') {
$this->connectionHandle = $value;
}
elseif ($name == 'chroot') {
$this->chrootPath = $value;
}
}

/**
* Implementation of the magic __isset() method.
*
* @param string $name
* The name of the variable to check.
*/
public function __isset($name) {
if ($name == 'connection') {
return isset($this->connectionHandle);
}
if ($name == 'chroot') {
return isset($this->chrootPath);
}
return FALSE;
}

return NULL;
/**
* Implementation of the magic __unset() method.
*
* @param string $name
* The name of the variable to unset.
*/
public function __unset($name) {
if ($name == 'connection') {
unset($this->connectionHandle);
}
elseif ($name == 'chroot') {
unset($this->chrootPath);
}
}

/**
Expand All @@ -89,23 +187,28 @@ abstract class FileTransfer {
* @param $destination
* The destination path.
*/
public final function copyDirectory($source, $destination) {
final public function copyDirectory($source, $destination) {
$source = $this->sanitizePath($source);
$destination = $this->fixRemotePath($destination);
$this->checkPath($destination);
$this->copyDirectoryJailed($source, $destination);
}

/**
* @see http://php.net/chmod
* Changes the permissions of the specified $path (file or directory).
*
* @param string $path
* The file / directory to change the permissions of.
* @param int $mode
* The new file permission mode to be passed to chmod().
* @param bool $recursive
* Pass TRUE to recursively chmod the entire directory specified in $path.
*
* @throws FileTransferException
*
* @see http://php.net/chmod
*/
public final function chmod($path, $mode, $recursive = FALSE) {
final public function chmod($path, $mode, $recursive = FALSE) {
if (!in_array('FileTransferChmodInterface', class_implements(get_class($this)))) {
throw new FileTransferException('Unable to change file permissions');
}
Expand Down Expand Up @@ -173,7 +276,6 @@ abstract class FileTransfer {
* A path to check against the jail.
*
* @throws FileTransferException
*
*/
protected final function checkPath($path) {
$full_jail = $this->chroot . $this->jail;
Expand All @@ -186,21 +288,25 @@ abstract class FileTransfer {

/**
* Returns a modified path suitable for passing to the server.
*
* If a path is a windows path, makes it POSIX compliant by removing the drive letter.
* If $this->chroot has a value, it is stripped from the path to allow for
* chroot'd filetransfer systems.
*
* @param $path
* The path to modify.
* @param $strip_chroot
* Whether to remove the path in $this->chroot.
*
* @return string
* The modified path.
*/
protected final function fixRemotePath($path, $strip_chroot = TRUE) {
$path = $this->sanitizePath($path);
$path = preg_replace('|^([a-z]{1}):|i', '', $path); // Strip out windows driveletter if its there.
if ($strip_chroot) {
if ($this->chroot && strpos($path, $this->chroot) === 0) {
$path = ($path == $this->chroot) ? '' : substr($path, strlen($this->chroot));
if ($this->chrootPath && strpos($path, $this->chrootPath) === 0) {
$path = ($path == $this->chrootPath) ? '' : substr($path, strlen($this->chrootPath));
}
}
return $path;
Expand Down Expand Up @@ -348,6 +454,9 @@ abstract class FileTransfer {
*
* Implementing classes can either extend this form with fields collecting the
* specific information they need, or override it entirely.
*
* @return array
* An array that contains a Form API definition.
*/
public function getSettingsForm() {
$form['username'] = array(
Expand Down
12 changes: 10 additions & 2 deletions docroot/core/includes/form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4964,7 +4964,8 @@ function theme_form_required_marker($variables) {
* @param $variables
* An associative array containing:
* - element: An associative array containing the properties of the element.
* Properties used: #required, #title, #id, #value, #description.
* Properties used: #required, #title, #id, #value, #description,
* #label_for.
*
* @ingroup themeable
*/
Expand Down Expand Up @@ -4993,7 +4994,14 @@ function theme_form_element_label($variables) {
$attributes['class'] = 'element-invisible';
}

if (!empty($element['#id'])) {
// Use the element's ID as the default value of the "for" attribute (to
// associate the label with this form element), but allow this to be
// overridden in order to associate the label with a different form element
// instead.
if (!empty($element['#label_for'])) {
$attributes['for'] = $element['#label_for'];
}
elseif (!empty($element['#id'])) {
$attributes['for'] = $element['#id'];
}

Expand Down
2 changes: 1 addition & 1 deletion docroot/core/includes/theme.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2049,7 +2049,7 @@ function theme_breadcrumb($variables) {
$output = '';
if (!empty($breadcrumb)) {
$output .= '<nav class="breadcrumb" aria-label="' . t('Website Orientation') . '">';
$output .= '<ol><li>' . implode(' » </li><li>', $breadcrumb) . '</li></ol>';
$output .= '<ol><li>' . implode('<span class="breadcrumb-separator" aria-hidden="true"> » </span></li><li>', $breadcrumb) . '</li></ol>';
$output .= '</nav>';
}
return $output;
Expand Down
6 changes: 3 additions & 3 deletions docroot/core/layouts/boxton/boxton.info
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ preview = boxton.png
; Include the Bootstrap4 Grid System
libraries[] = bootstrap4-gs

; Added by Backdrop CMS packaging script on 2023-09-15
; Added by Backdrop CMS packaging script on 2023-10-06
project = backdrop
version = 1.26.0
timestamp = 1694823391
version = 1.26.1
timestamp = 1696627719
6 changes: 3 additions & 3 deletions docroot/core/layouts/geary/geary.info
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ preview = geary.png
; Include the Bootstrap4 Grid System
libraries[] = bootstrap4-gs

; Added by Backdrop CMS packaging script on 2023-09-15
; Added by Backdrop CMS packaging script on 2023-10-06
project = backdrop
version = 1.26.0
timestamp = 1694823391
version = 1.26.1
timestamp = 1696627719
6 changes: 3 additions & 3 deletions docroot/core/layouts/harris/harris.info
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ preview = harris.png
; Include the Bootstrap4 Grid System
libraries[] = bootstrap4-gs

; Added by Backdrop CMS packaging script on 2023-09-15
; Added by Backdrop CMS packaging script on 2023-10-06
project = backdrop
version = 1.26.0
timestamp = 1694823391
version = 1.26.1
timestamp = 1696627719
6 changes: 3 additions & 3 deletions docroot/core/layouts/legacy/one_column/one_column.info
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ regions[footer] = Footer
; Modify this line if you would like to change the default in this layout.
default region = content

; Added by Backdrop CMS packaging script on 2023-09-15
; Added by Backdrop CMS packaging script on 2023-10-06
project = backdrop
version = 1.26.0
timestamp = 1694823391
version = 1.26.1
timestamp = 1696627719
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ regions[footer] = Footer bottom
; Modify this line if you would like to change the default in this layout.
default region = content

; Added by Backdrop CMS packaging script on 2023-09-15
; Added by Backdrop CMS packaging script on 2023-10-06
project = backdrop
version = 1.26.0
timestamp = 1694823391
version = 1.26.1
timestamp = 1696627719
6 changes: 3 additions & 3 deletions docroot/core/layouts/legacy/two_column/two_column.info
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ regions[footer] = Footer
; Modify this line if you would like to change the default in this layout.
default region = content

; Added by Backdrop CMS packaging script on 2023-09-15
; Added by Backdrop CMS packaging script on 2023-10-06
project = backdrop
version = 1.26.0
timestamp = 1694823391
version = 1.26.1
timestamp = 1696627719
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ regions[footer] = Footer
; Modify this line if you would like to change the default in this layout.
default region = content

; Added by Backdrop CMS packaging script on 2023-09-15
; Added by Backdrop CMS packaging script on 2023-10-06
project = backdrop
version = 1.26.0
timestamp = 1694823391
version = 1.26.1
timestamp = 1696627719
6 changes: 3 additions & 3 deletions docroot/core/layouts/moscone/moscone.info
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ preview = moscone.png
; Include the Bootstrap4 Grid System
libraries[] = bootstrap4-gs

; Added by Backdrop CMS packaging script on 2023-09-15
; Added by Backdrop CMS packaging script on 2023-10-06
project = backdrop
version = 1.26.0
timestamp = 1694823391
version = 1.26.1
timestamp = 1696627719
Loading

0 comments on commit 92f67a7

Please sign in to comment.