403Webshell
Server IP : 104.21.21.239  /  Your IP : 216.73.216.11
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5
System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/banners/public_html/bway/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/banners/public_html/bway/feed_regional-v2.php
<?php
// Replaces: feed_regional-v2.cfm
// RSS v2 with media:content namespace - joins columntableimages, 30 items
// Has enclosure, media:content, and image elements. Region 32 special handling.
require_once __DIR__ . '/db/mysql_bootstrap.php';

/**
 * Clean special characters from text for XML safety.
 * Replaces smart quotes, em dashes, and other problematic characters,
 * then applies htmlspecialchars for proper XML encoding.
 */
function cleanXmlText($text) {
    $text = str_replace(
        ["\x91", "\x92", "\x93", "\x94", "\x96", "\xE2\x80\x98", "\xE2\x80\x99", "\xE2\x80\x9C", "\xE2\x80\x9D", "\xE2\x80\x93", "\xE2\x80\x94", "&nbsp;"],
        ["'",    "'",    "'",    "'",    "-",    "'",              "'",              '"',              '"',              "-",              "--",             ""],
        $text
    );
    return htmlspecialchars($text, ENT_XML1, 'UTF-8');
}

header('Content-Type: text/xml; charset=utf-8');

if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
    exit;
}
$regionId = (int)$_GET['id'];

// Block region 77
if ($regionId === 77) {
    exit;
}

$dsn = 'mysql:host=amazonaurora.cluster-ro-cemzxojvmybt.us-east-1.rds.amazonaws.com;dbname=amazonrds;charset=utf8mb4';
$dbUser = 'admin';
$dbPass = 'xxatN6Lb8Kbwb9MiU1At';

try {
    $pdo = new PDO($dsn, $dbUser, $dbPass, mysqlPdoOptions([
        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
        PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
    ]));
} catch (PDOException $e) {
    exit('Database connection failed.');
}

// Get region info
$stmtRegion = $pdo->prepare("SELECT regions.name, regions.regionurl FROM bway_bww.regions WHERE id = ?");
$stmtRegion->execute([$regionId]);
$region = $stmtRegion->fetch();

if (!$region) {
    exit;
}

$sql = "SELECT authorname, title, copy AS blurb, dateposted, twitterheadline,
        photoreturn, mainswap680, seo_friendly, mainswapbig AS mainswap,
        columntable.id AS colid, media
    FROM bway_bww.columntable
    INNER JOIN bway_bww.regionstable ON columntable.id = regionstable.colid
    INNER JOIN bway_bww.columntableimages ON columntable.id = columntableimages.ID
    WHERE columntable.status = 1 AND regionstable.regionsid = ?";

$params = [$regionId];

if ($regionId === 32) {
    $sql .= " AND columntableimages.regionaltop <> 1";
}

$sql .= " AND regionstable.colid > 2281154
    AND columntable.id > 2281154
    AND columntableimages.id > 2281154
    ORDER BY columntable.id DESC
    LIMIT 0, 30";

$stmt = $pdo->prepare($sql);
$stmt->execute($params);
$rows = $stmt->fetchAll();

if (empty($rows)) {
    exit;
}

$now = new DateTime('now', new DateTimeZone('America/Los_Angeles'));
$theDatetime = $now->format('D, d M Y H:i:s') . ' PST';
$regionName = htmlspecialchars($region['name'], ENT_XML1, 'UTF-8');
$regionUrl = htmlspecialchars($region['regionurl'], ENT_XML1, 'UTF-8');

echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
<rss xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
<channel>
<title>BroadwayWorld.com <?php echo $regionName; ?> Stories</title>
<link>https://www.broadwayworld.com</link>
<description>Latest BroadwayWorld.com <?php echo $regionName; ?> News, Reviews, and More...</description>
<language>en-us</language>
<copyright>Copyright BroadwayWorld.com</copyright>
<docs>http://backend.userland.com/rss</docs>
<lastBuildDate><?php echo $theDatetime; ?></lastBuildDate>
<ttl>10</ttl>
<image>
<title>BroadwayWorld.com</title>
<url>https://www.broadwayworld.com/broadwaymain.gif</url>
<link>https://www.broadwayworld.com</link>
</image>
<?php foreach ($rows as $row):
    // Skip TV Scoop items
    if (stripos($row['title'], 'TV Scoop') !== false) {
        continue;
    }
    $datePosted = new DateTime($row['dateposted']);
    $pubDate = $datePosted->format('D, d M Y H:i:s') . ' PST';
    $title = cleanXmlText($row['title']);
    $description = cleanXmlText($row['blurb']);
    $seoFriendly = htmlspecialchars($row['seo_friendly'], ENT_XML1, 'UTF-8');
    $mainswap = htmlspecialchars($row['mainswap'], ENT_XML1, 'UTF-8');
    $mainswap680 = htmlspecialchars($row['mainswap680'], ENT_XML1, 'UTF-8');
    $colid = (int)$row['colid'];
    $link = 'https://' . $regionUrl . '/article/' . $seoFriendly;

    // Ensure https for image URL
    $imageUrl = str_replace('http:', 'https:', $row['mainswap']);
    $imageUrl = htmlspecialchars($imageUrl, ENT_XML1, 'UTF-8');

    // Build video play link if media exists
    $videoLink = '';
    if (!empty($row['media'])) {
        $videoLink = htmlspecialchars('<p><a href="https://www.broadwayworld.com/videoplay.php?colid=' . $colid . '">Click Here to Play!</a>', ENT_XML1, 'UTF-8');
    }

    // Comscore pixel
    $comscore = htmlspecialchars('<img src="https://b.scorecardresearch.com/p?c1=2&c2=18162732&cv=2.0&cj=1"  width="1" height="1" style="width:1px;height:1px" />', ENT_XML1, 'UTF-8');
?>
<item>
<title><?php echo $title; ?></title>
<description><?php echo $description; ?><?php if (!empty($row['media'])) echo $videoLink; ?><?php echo $comscore; ?></description>
<link><?php echo $link; ?></link>
<enclosure url="<?php echo $mainswap; ?>" type="image/jpeg" />
<media:content url="<?php echo $mainswap680; ?>" type="image/jpeg" medium="image" />
<image><?php echo $imageUrl; ?></image>
<guid isPermaLink="true"><?php echo $link; ?></guid>
<pubDate><?php echo $pubDate; ?></pubDate>
</item>
<?php endforeach; ?>
</channel>
</rss>

Youez - 2016 - github.com/yon3zu
LinuXploit