Index: branches/5.1.x/core/install/upgrades.php =================================================================== diff -u -N -r13780 -r13824 --- branches/5.1.x/core/install/upgrades.php (.../upgrades.php) (revision 13780) +++ branches/5.1.x/core/install/upgrades.php (.../upgrades.php) (revision 13824) @@ -1,6 +1,6 @@ Conn->Query('ALTER TABLE ' . TABLE_PREFIX . 'Events DROP FromUserId'); } + + /** + * Update to 5.1.0; Fixes refferer of form submissions + * + * @param string $mode when called mode {before, after) + */ + function Upgrade_5_1_0($mode) + { + if ($mode == 'after') { + $base_url = $this->Application->BaseURL(); + + $sql = 'UPDATE ' . TABLE_PREFIX . 'FormSubmissions + SET ReferrerURL = REPLACE(ReferrerURL, ' . $this->Conn->qstr($base_url) . ', "/")'; + $this->Conn->Query($sql); + } + } } \ No newline at end of file