1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 20:57:26 +02:00

Closes #5171 Social trackers updated

This commit is contained in:
camer0n
2024-01-19 13:23:01 -08:00
parent 04030cb039
commit dbb9c74727
2 changed files with 34 additions and 33 deletions

View File

@@ -5306,7 +5306,7 @@ class eHelper
*/ */
public static function removeTrackers($get = array()) public static function removeTrackers($get = array())
{ {
$trackers = array('fbclid','utm_source','utm_medium','utm_content','utm_campaign','elan', 'msclkid', 'gclid'); $trackers = array('fbclid','utm_source','utm_medium','utm_content','utm_campaign','elan', 'msclkid', 'gclid', 'gad', 'gad_source');
foreach($trackers as $val) foreach($trackers as $val)
{ {

View File

@@ -37,35 +37,35 @@
function testGetPerms() function testGetPerms()
{ {
// $this->markTestSkipped("Skipped - CLI mode changes behavior."); // self::markTestSkipped("Skipped - CLI mode changes behavior.");
// See class2.php Line 1643 // See class2.php Line 1643
$result = getperms('N', '5'); $result = getperms('N', '5');
$this->assertFalse($result); self::assertFalse($result);
$result = getperms('N', '0'); $result = getperms('N', '0');
$this->assertTrue($result); self::assertTrue($result);
$result = getperms('N', '0.'); $result = getperms('N', '0.');
$this->assertTrue($result); self::assertTrue($result);
$result = getperms('U1|U2', '0.'); $result = getperms('U1|U2', '0.');
$this->assertTrue($result); self::assertTrue($result);
$result = getperms('0', ' '); $result = getperms('0', ' ');
$this->assertFalse($result); self::assertFalse($result);
$result = getperms(0, '0'); $result = getperms(0, '0');
$this->assertTrue($result); self::assertTrue($result);
$pid = e107::getDb()->retrieve('plugin', 'plugin_id', "plugin_path = 'gallery'"); $pid = e107::getDb()->retrieve('plugin', 'plugin_id', "plugin_path = 'gallery'");
$result = getperms('P', 'P'.$pid); $result = getperms('P', 'P'.$pid);
$this->assertFalse($result); self::assertFalse($result);
$result = getperms('P', 'P'.$pid, 'http://localhost/e107v2/e107_plugins/gallery/admin_config.php'); $result = getperms('P', 'P'.$pid, 'http://localhost/e107v2/e107_plugins/gallery/admin_config.php');
$this->assertTrue($result); self::assertTrue($result);
} }
@@ -73,7 +73,8 @@
function testUserModel() function testUserModel()
{ {
$result = e107::getUser(); $result = e107::getUser();
var_dump($result); self::assertIsObject($result);
} }
@@ -85,46 +86,46 @@
$_E107['phpunit'] = true; $_E107['phpunit'] = true;
$result = check_class(0, "253,254,250,251,0"); $result = check_class(0, "253,254,250,251,0");
$this->assertTrue($result); self::assertTrue($result);
$result = check_class('NEWSLETTER', "253,254,250,251,0"); $result = check_class('NEWSLETTER', "253,254,250,251,0");
$this->assertFalse($result); self::assertFalse($result);
$result = check_class('NEWSLETTER', "253,254,250,251,3,0"); // NEWSLETTER = 3 $result = check_class('NEWSLETTER', "253,254,250,251,3,0"); // NEWSLETTER = 3
$this->assertTrue($result); self::assertTrue($result);
$result = check_class('-NEWSLETTER', "253,254,250,251,0"); $result = check_class('-NEWSLETTER', "253,254,250,251,0");
$this->assertTrue($result); self::assertTrue($result);
$result = check_class(254, "253,254,250,251,0"); $result = check_class(254, "253,254,250,251,0");
$this->assertTrue($result); self::assertTrue($result);
$result = check_class('0', "253,254,250,251,0"); $result = check_class('0', "253,254,250,251,0");
$this->assertTrue($result); self::assertTrue($result);
$result = check_class(null, "253,254,250,251,0"); $result = check_class(null, "253,254,250,251,0");
$this->assertFalse($result); self::assertFalse($result);
$result = check_class('-254', "253,254,250,251,0"); $result = check_class('-254', "253,254,250,251,0");
$this->assertFalse($result); self::assertFalse($result);
$result = check_class('-254', "253,250,251,0"); $result = check_class('-254', "253,250,251,0");
$this->assertTrue($result); self::assertTrue($result);
$result = check_class(-254, "253,250,251,0"); $result = check_class(-254, "253,250,251,0");
$this->assertTrue($result); self::assertTrue($result);
$result = check_class(-254, "254,253,250,251,0"); $result = check_class(-254, "254,253,250,251,0");
$this->assertFalse($result); self::assertFalse($result);
$result = check_class(e_UC_NOBODY, "253,254,250,251,0"); $result = check_class(e_UC_NOBODY, "253,254,250,251,0");
$this->assertFalse($result); self::assertFalse($result);
$result = check_class(e_UC_NEWUSER, "247,253,254,250,251,0"); $result = check_class(e_UC_NEWUSER, "247,253,254,250,251,0");
$this->assertTrue($result); self::assertTrue($result);
$result = check_class(e_UC_NEWUSER, "253,254,250,251,0"); $result = check_class(e_UC_NEWUSER, "253,254,250,251,0");
$this->assertFalse($result); self::assertFalse($result);
unset($_E107['phpunit']); unset($_E107['phpunit']);
} }
@@ -134,13 +135,13 @@
function testCheckEmail() function testCheckEmail()
{ {
$result = check_email("test@somewhere.com"); // good email. $result = check_email("test@somewhere.com"); // good email.
$this->assertEquals('test@somewhere.com', $result); self::assertEquals('test@somewhere.com', $result);
$result = check_email("test@somewherecom"); // Missing . $result = check_email("test@somewherecom"); // Missing .
$this->assertFalse($result); self::assertFalse($result);
$result = check_email("test@somewhere.technology"); // New TLDs $result = check_email("test@somewhere.technology"); // New TLDs
$this->assertEquals('test@somewhere.technology',$result); self::assertEquals('test@somewhere.technology',$result);
} }
@@ -158,7 +159,7 @@
foreach($tests as $zone=>$expected) foreach($tests as $zone=>$expected)
{ {
$result = systemTimeZoneIsValid($zone); $result = systemTimeZoneIsValid($zone);
$this->assertSame($expected, $result); self::assertSame($expected, $result);
} }
@@ -605,18 +606,18 @@
*/ */
/*function testSystemTimeZones() /*function testSystemTimeZones()
{ {
$expected = $this->getExpectedZones(); $expected = self::getExpectedZones();
// $this->echoMem(); // self::echoMem();
$zones = systemTimeZones(); $zones = systemTimeZones();
// $this->echoMem(); // self::echoMem();
$zoneKeys = array_keys($zones); $zoneKeys = array_keys($zones);
$expectedKeys = array_keys($expected); $expectedKeys = array_keys($expected);
$this->assertSame($expectedKeys, $zoneKeys); self::assertSame($expectedKeys, $zoneKeys);
}*/ }*/