Fixed handling of maturity flags when saving or updating classified ads.

The code now handles the flags correct when dealing with old viewers
that use the legacy PG and Mature bits, or that don't set the PG bit.
This commit is contained in:
Kevin Cozens
2021-01-31 15:38:33 -05:00
parent 00db0cf818
commit 4f8320d3fe
+4 -2
View File
@@ -132,8 +132,10 @@ function classified_update($method_name, $params, $app_data)
//If PG, Mature, and Adult flags are all 0 assume PG and set bit 2.
//This works around what might be a viewer bug regarding the flags.
//The ossearch query.php file expects bit 2 set for any PG listing.
if (($classifiedflag & 76) == 0)
$classifiedflag |= 4;
if ($classifiedflag & 2) //Legacy mature bit set?
$classifiedflag |= 8; //Set current mature bit
if (($classifiedflag & 0x4E) == 0) //No bits set?
$classifiedflag |= 4; //Set PG bit (1 << 2)
//Renew Weekly flag is 32 (1 << 5)
if (($classifiedflag & 32) == 0)