From 4f8320d3fecfa107a006d3e616bd6fc81fc5cb6b Mon Sep 17 00:00:00 2001 From: Kevin Cozens Date: Sun, 31 Jan 2021 15:35:44 -0500 Subject: [PATCH] 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. --- webroot/profile.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webroot/profile.php b/webroot/profile.php index ebf57d0..eb25358 100644 --- a/webroot/profile.php +++ b/webroot/profile.php @@ -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)