Update Drupal 7 dependencies

This commit is contained in:
Mauricio Dinarte 2025-06-03 10:37:00 -06:00 committed by Janez Urevc
parent 7d902ba1ef
commit 13df912654
391 changed files with 2900 additions and 1502 deletions

View file

@ -63,6 +63,14 @@ class InsertQuery_mysql extends InsertQuery {
$max_placeholder = 0;
$values = array();
if (!is_array($this->insertValues)) {
if (version_compare(PHP_VERSION, '7.4', '>=')) {
throw new UnexpectedValueException();
}
else {
drupal_trigger_fatal_error('Unexpected Value');
}
}
if (count($this->insertValues)) {
foreach ($this->insertValues as $insert_values) {
$placeholders = array();
@ -96,6 +104,14 @@ class TruncateQuery_mysql extends TruncateQuery { }
class UpdateQuery_mysql extends UpdateQuery {
public function __toString() {
if (method_exists($this->connection, 'escapeField')) {
if (!is_array($this->fields)) {
if (version_compare(PHP_VERSION, '7.4', '>=')) {
throw new UnexpectedValueException();
}
else {
drupal_trigger_fatal_error('Unexpected Value');
}
}
$escapedFields = array();
foreach ($this->fields as $field => $data) {
$field = $this->connection->escapeField($field);

View file

@ -120,7 +120,15 @@ class InsertQuery_pgsql extends InsertQuery {
$max_placeholder = 0;
$values = array();
if (count($this->insertValues)) {
if (!is_array($this->insertValues)) {
if (version_compare(PHP_VERSION, '7.4', '>=')) {
throw new UnexpectedValueException();
}
else {
drupal_trigger_fatal_error('Unexpected Value');
}
}
if (count($this->insertValues)) {
foreach ($this->insertValues as $insert_values) {
$placeholders = array();

View file

@ -293,6 +293,15 @@ class DatabaseStatementPrefetch implements Iterator, DatabaseStatementInterface
$class_name = $this->fetchOptions['class'];
}
if (count($this->fetchOptions['constructor_args'])) {
// Verify the current db connection to avoid this code being called
// in an inappropriate context.
$db_connection_options = Database::getConnection()->getConnectionOptions();
$defaults = array('sqlite', 'oracle');
$extras = variable_get('database_statement_prefetch_valid_db_drivers', array());
$valid_db_drivers = array_merge($defaults, $extras);
if (!in_array($db_connection_options['driver'], $valid_db_drivers)) {
throw new BadMethodCallException();
}
$reflector = new ReflectionClass($class_name);
$result = $reflector->newInstanceArgs($this->fetchOptions['constructor_args']);
}

View file

@ -1190,6 +1190,15 @@ class UpdateQuery extends Query implements QueryConditionInterface {
* The prepared statement.
*/
public function __toString() {
if (!is_array($this->expressionFields) || !is_array($this->fields)) {
if (version_compare(PHP_VERSION, '7.4', '>=')) {
throw new UnexpectedValueException();
}
else {
drupal_trigger_fatal_error('Unexpected Value');
}
}
// Create a sanitized comment string to prepend to the query.
$comments = $this->connection->makeComment($this->comments);

View file

@ -134,6 +134,9 @@ class DatabaseConnection_sqlite extends DatabaseConnection {
*/
public function __destruct() {
if ($this->tableDropped && !empty($this->attachedDatabases)) {
if (!is_array($this->attachedDatabases)) {
throw new UnexpectedValueException();
}
foreach ($this->attachedDatabases as $prefix) {
// Check if the database is now empty, ignore the internal SQLite tables.
try {