Skip to content

Commit

Permalink
Detard plus nits.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Aug 30, 2023
1 parent 125f214 commit 51a7440
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions batch/savepapers.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ function __construct(Conf $conf) {
function set_args($arg) {
$this->quiet = isset($arg["q"]);
$this->ignore_errors = isset($arg["ignore-errors"]);
if (isset($args["ignore-pid"])) {
if (isset($arg["ignore-pid"])) {
$this->pidflags |= Paper_API::PIDFLAG_IGNORE_PID;
}
if (isset($args["match-title"])) {
if (isset($arg["match-title"])) {
$this->pidflags |= Paper_API::PIDFLAG_MATCH_TITLE;
}
$this->disable_users = isset($arg["disable-users"]);
Expand Down
3 changes: 2 additions & 1 deletion src/api/api_paper.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ static function analyze_json_pid(Conf $conf, $j, $pidflags = 0) {
}
unset($j->pid, $j->id);
}
if (!isset($j->pid) && !isset($j->id)
if (!isset($j->pid)
&& !isset($j->id)
&& ($pidflags & self::PIDFLAG_MATCH_TITLE) !== 0
&& is_string($j->title ?? null)) {
$pids = Dbl::fetch_first_columns($conf->dblink, "select paperId from Paper where title=?", simplify_whitespace($j->title));
Expand Down
2 changes: 1 addition & 1 deletion src/papercolumns/pc_tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function add_decoration($decor) {
if ($decor === "edit") {
$this->editable = true;
return $this->__add_decoration($decor);
} else if (preg_match('/\A%\d*(?:\.\d*)[bdeEfFgGoxX]\z/', $decor)) {
} else if (preg_match('/\A%?\d*(?:\.\d*)[bdeEfFgGoxX]\z/', $decor)) {
$this->__add_decoration($decor, [$this->real_format]);
$this->real_format = $decor;
return true;
Expand Down

0 comments on commit 51a7440

Please sign in to comment.