Skip to content

Commit

Permalink
Fix: Upload's db fields, if given a string value would actually set t…
Browse files Browse the repository at this point in the history
…he system path, rather than the value given.

https://datatables.net/forums/discussion/78305
  • Loading branch information
AllanJard committed Feb 27, 2024
1 parent 6179d89 commit e908d5e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Editor/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,18 @@ private function _dbExec($upload, $db)
->where($this->_dbPKey, $id);

foreach ($pathFields as $column => $type) {
$q->set($column, $type === self::DB_WEB_PATH ? $webPath : $path);
if ($type === self::DB_WEB_PATH) {
$q->set($column, $webPath);
}
else if ($type === self::DB_SYSTEM_PATH) {
$q->set($column, $path);
}
else if (is_string($type)) {

Check failure on line 704 in Editor/Upload.php

View workflow job for this annotation

GitHub Actions / Unit (latest, StaticAnalysis)

Call to function is_string() with non-falsy-string will always evaluate to true.
$q->set($column, str_replace('__ID__', $id, $type));
}
else {
$q->set($column, $type);
}
}

$q->exec();
Expand Down

0 comments on commit e908d5e

Please sign in to comment.