diff --git a/ChangeLog b/ChangeLog index 3ac0491..7a0000b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,8 @@ List of changes between releases of Extension:JsCalendar. == master branch (will become JsCalendar 0.4.1 or 0.5.0, depending on magnitude of changes) == -No changes since JsCalendar 0.4.0. +Features: +* Support PostgreSQL. == JsCalendar 0.4.0 == diff --git a/README.md b/README.md index 2b65808..46ad6ca 100644 --- a/README.md +++ b/README.md @@ -109,10 +109,6 @@ The following parameter within `` will change the color of event keywordcolor.arctic = yellow keywordcolor.statistically = lightgreen -### Requirements - -* MySQL (this extension doesn't support PostgreSQL. Patches that add PostgreSQL support are very welcome, but maintainter of this extension won't be implementing this himself). - ### Installation 1. Deploy the files to `extensions/JsCalendar`. diff --git a/includes/FindEventPagesQuery.php b/includes/FindEventPagesQuery.php index a99ac52..ba26d10 100644 --- a/includes/FindEventPagesQuery.php +++ b/includes/FindEventPagesQuery.php @@ -109,6 +109,10 @@ public function setTitleRegex( $regex ) { return; } + // Don't include named capture brackets into the SQL query, + // they are not needed there, and PostgreSQL can't parse a regex that has them. + $regex = str_replace( [ '?', '?' ], [], $regex ); + $rlike = $this->dbr->getType() === 'postgres' ? '~' : 'RLIKE'; $this->where[] = "page_title $rlike " . $this->dbr->addQuotes( $regex ); }