Permalink bug

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

---
<?= "Jenolan(Larry) :: Coding Since 1973" ?>
Peace and Long Life