Permalink bug
1 posts by 1 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: October 28, 2017 (RSS)
By jenolan - October 28, 2017
In the permalink plugin main file 'permalinks.php' the addPermalink function line 75 it is only checking that the record number for the new link is not a duplicate as all tables share this it needs to make sure that the tableName and recordNum belong not just the num
This...
$permalinkRecord = mysql_get('_permalinks', null, array('permalink' => $link)); // check if permalink already exists in database
$isAlreadyUsed = $permalinkRecord && $permalinkRecord['recordNum'] != $num;
Should be
$permalinkRecord = mysql_get('_permalinks', null, array('permalink' => $link)); // check if permalink already exists in database
$isAlreadyUsed = $permalinkRecord && $table != $permalinkRecord['tableName'] && $permalinkRecord['recordNum'] != $num;
Larry
Peace and Long Life