function __get($k) { if ($k == 'editKey') { return substr($this->auth, 20, 10); } else { if ($k == 'stale') { $cutoff = time() - 365 * (24 * 60 * 60); $stamp = strtotime($this->updated); return $stamp < $cutoff; } else { if ($k == 'descriptionHtml') { return hashlinks(linkify(htmlify($this->description))); } else { if ($k == 'descriptionSummary') { return htmlify(substr_replace($this->description, ' ...', 140), false); } else { if ($k == 'rssDate') { // TODO: Is there a better way to handle the timezone? Mysql times are // GMT and have to be parsed as such. $oldtz = date_default_timezone_get(); date_default_timezone_set('GMT'); return date('D, d M Y H:i:s T', strtotime($this->updated)); date_default_timezone_set($oldtz); } } } } } return parent::__get($k); }
function __get($k) { if (strpos($k, 'html_') === 0) { $k = substr($k, 5); return htmlify($this->{$k}); } return parent::__get($k); }
public function testFunction() { $this->assertEquals('ä', htmlify('ä')); $this->assertEquals('Ä', htmlify('Ä')); $this->assertEquals('ö', htmlify('ö')); $this->assertEquals('Ö', htmlify('Ö')); $this->assertEquals('ü', htmlify('ü')); $this->assertEquals('Ü', htmlify('Ü')); $this->assertEquals('ß', htmlify('ß')); $this->assertEquals('…', htmlify('...')); $this->assertEquals('&', htmlify('&')); $this->assertEquals(''', htmlify("'")); $this->assertEquals('"', htmlify('"')); $this->assertEquals('Der Ärger ist groß, wenn man es übertrteibt.', htmlify('Der Ärger ist groß, wenn man es übertrteibt.')); }
public function testExampleSignupMode2() { $original = <<<EOF 2015-07-05 14:31:51 Signup created. 2015-07-05 14:31:51 ( system ) - User self signup. User requirement: testing <3 2015-07-15 19:18:37 (wishy) - Paypal - £22 - Bob Status changed from PAYPAL_WAITING to PAID. 2015-10-16 21:38:35 ( system ) - Authenticated machine: 00:11:22:33:44:55:66 EOF; $expected = <<<EOF 2015-07-05 14:31:51 Signup created. <br /> 2015-07-05 14:31:51 ( system ) - User self signup. User requirement: testing <3<br /> 2015-07-15 19:18:37 (wishy) - Paypal - £22 - Bob Status changed from PAYPAL_WAITING to PAID. <br /> 2015-10-16 21:38:35 ( system ) - Authenticated machine: 00:11:22:33:44:55:66 EOF; $this->assertEquals($expected, htmlify($original, 2)); }
public function __construct() { parent::__construct('formEditEvent', 'Edit Event'); $event = $this->getEvent(); $isAdmin = Session::getUser()->hasPriv('MODERATE_EVENTS'); $isOwner = Session::getUser()->getData('organization') == $event['organizer']; if (!$isAdmin && !$isOwner) { throw new Exception('You do not have the privs for this.'); } else { if ($isAdmin) { $el = FormHelpers::getOrganizerList(true); $el->setValue($event['organizer']); $this->addElement($el); } } $this->addElement(Element::factory('hidden', 'id', 'event id', $event['id'])); $this->addElement(Element::factory('text', 'title', 'Title', $event['title'])); if ($isAdmin) { $this->addElement(FormHelpers::getVenueListElement(null, true)); } else { $this->addElement(FormHelpers::getVenueListElement(Session::getUser()->getData('organization'), true)); } $this->getElement('venue')->setValue($event['venue']); $this->addElement(Element::factory('text', 'dateStart', 'Start', $event['dateStart'])); $this->addElement(Element::factory('text', 'dateFinish', 'Finish', $event['dateFinish'])); $this->addScript('$("#formEditEvent-dateStart").datetime({"firstDay": 1 })'); $this->addScript('$("#formEditEvent-dateFinish").datetime({"firstDay": 2 })'); $this->addElement(Element::factory('numeric', 'priceOnDoor', 'Ticket price on the door', $event['priceOnDoor'])); $this->addElement(Element::factory('numeric', 'priceInAdv', 'Ticket price in advance', $event['priceInAdv'])); $this->addElement($this->getElementCurrency($event['currency'])); $this->addElement(Element::factory('text', 'website', 'Event website', $event['website'])); $this->addElement(Element::factory('checkbox', 'showers', 'Showers', $event['showers'])); $this->addElement($this->getElementSleeping($event['sleeping'])); $this->addElement(Element::factory('checkbox', 'alcohol', 'Bring your own alcohol?', $event['alcohol'])); $this->addElement(Element::factory('checkbox', 'smoking', 'Smoking area?', $event['smoking'])); $this->addElement(Element::factory('numeric', 'networkMbps', 'Network (mbps)', $event['networkMbps'])); $this->getElement('networkMbps')->addSuggestedValue('100', 'Old 100 meg network'); $this->getElement('networkMbps')->addSuggestedValue('1000', 'Shiny Gigabit network'); $this->addElement(Element::factory('numeric', 'internetMbps', 'Internet (mbps)', $event['internetMbps'], 'If you have an internet connection, what speed is it? Enter 0 for no connection.')); $this->getElement('internetMbps')->addSuggestedValue('0', 'No internet!'); $this->getElement('internetMbps')->addSuggestedValue('2', '2mbps'); $this->getElement('internetMbps')->addSuggestedValue('8', '8mbps'); $this->addElement(Element::factory('numeric', 'numberOfSeats', 'Number of seats', $event['numberOfSeats'])); $this->addElement(Element::factory('textarea', 'blurb', 'Additional blurb', htmlify($event['blurb']))); $this->addButtons(Form::BTN_SUBMIT); }
public function __construct($id) { parent::__construct('edit', 'Edit news'); global $db; $sql = 'SELECT title, content FROM news WHERE id = :id LIMIT 1'; $stmt = $db->prepare($sql); $stmt->bindValue(':id', $id); $stmt->execute(); if ($stmt->numRows() == 0) { throw new Exception('News item not found'); } $news = $stmt->fetchRow(); $this->addElement(new ElementHidden('action', null, 'edit')); $this->addElement(new ElementHidden('id', null, $id)); $this->addElement(new ElementInput('title', 'Title', $news['title'])); $this->addElement(new ElementTextbox('content', 'Content', stripslashes(htmlify($news['content'])))); $this->addDefaultButtons(); }
public function __construct() { parent::__construct('formEditOrganizer', 'Edit Organizer'); $organizer = fetchOrganizer($_REQUEST['formEditOrganizer-id']); if (Session::getUser()->hasPriv('PUBLISH_ORGANIZERS')) { $this->addElement(Element::factory('checkbox', 'published', 'Published', $organizer['published'])); } $this->addElement(Element::factory('text', 'title', 'Title', $organizer['title'])); $this->addElement(Element::factory('hidden', 'id', null, $organizer['id'])); $this->addElement(Element::factory('text', 'websiteUrl', 'Website', $organizer['websiteUrl'])); $this->addElement(Element::factory('date', 'assumedStale', 'Assumed stale since', $organizer['assumedStale'])); $this->addElement(Element::factory('text', 'steamGroupUrl', 'Steam group URL', htmlify($organizer['steamGroupUrl']))); $this->getElement('steamGroupUrl')->setMinMaxLengths(0, 255); $this->addElement(Element::factory('textarea', 'blurb', 'Blurb', $organizer['blurb'])); $this->addElement(Element::factory('file', 'banner', 'Banner image', null, 'Your organizer banner image. Preferably a PNG, maximum image size is 468x160')); $this->getElement('banner')->destinationDir = 'resources/images/organizer-logos/'; $this->getElement('banner')->destinationFilename = $organizer['id'] . '.jpg'; $this->getElement('banner')->setMaxImageBounds(468, 160); if (!Session::hasPriv('EDIT_ORGANIZER') && Session::getUser()->getData('organization') != $organizer['id']) { throw new PermissionsException(); } $this->addButtons(Form::BTN_SUBMIT); }
public function getCiteHtml() { $dataProvider = new CiteProvider(WS_DATA_DIRECTORY . '/cites.xml'); $collection = $dataProvider->getCollection(); $shuffler = new CiteShuffler($collection); $cite = $shuffler->getCite(); $sb = new Monkey\StringBuilder('<h2>Ein Zitat das Weltraumschaf gut findet</h2>'); $sb->append('<div id="cite">'); $sb->append('<p>'); $sb->append(htmlify($cite->getText())); $sb->append('</p>'); $sb->append('<p>'); $sb->append('<em>'); $sb->append(htmlify($cite->getAuthor())); if ($cite->hastitle()) { $sb->append(' ('); $sb->append(htmlify($cite->getTitle())); $sb->append(')'); } $sb->append('</em>'); $sb->append('</p>'); $sb->append('</div>'); return $sb; }
?> )</p> <?php } ?> </div> <?php if (false && $entry->geocode) { ?> <div id="map"> <iframe <?php $mapUrl = $entry->address; $mapUrl = preg_replace('/\\s/', '+', $mapUrl); $mapUrl = "http://maps.google.com/maps?q=" . htmlify($mapUrl); ?> width="200" height="200" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="<?php echo $mapUrl . "&output=embed&iwloc=near"; ?> "></iframe> <br /> <a href="<?php echo $mapUrl; ?>
function Display() { $port = $this->port; $HTML = ''; # $HTML = $this->JavascriptInclude(); $MarkedAsNew = "N"; $HTML .= "<DL>\n"; $HTML .= "<DT>"; $HTML .= port_display_WATCH_LIST_ADD_REMOVE; $HTML .= '<BIG><B>'; if ($this->LinkToPort) { $HTML .= $this->LinkToPort(); } else { $HTML .= $port->port; } $HTML .= "</B></BIG>"; // description if ($port->short_description && ($this->ShowShortDescription || $this->ShowEverything)) { $HTML .= ' <span class="fp_description_short">' . htmlify(_forDisplay($port->short_description)) . '</span>'; $HTML .= "<br>\n"; } $HTML .= "<b>"; $PackageVersion = freshports_PackageVersion($port->{'version'}, $port->{'revision'}, $port->{'epoch'}); if (strlen($PackageVersion) > 0) { $HTML .= ' ' . $PackageVersion; } if (isset($port->category_looking_at)) { if ($port->category_looking_at != $port->category) { $HTML .= '<sup>*</sup>'; } } $HTML .= "</b>"; if ($this->ShowEverything || $this->ShowCategory) { $HTML .= ' <A HREF="/' . $port->category . '/" TITLE="The category for this port">' . $port->category . '</A>'; } // indicate if this port has been removed from cvs if ($port->IsDeleted()) { $HTML .= " " . freshports_Deleted_Icon_Link() . "\n"; } // indicate if this port needs refreshing from CVS if ($port->{'needs_refresh'}) { $HTML .= " " . freshports_Refresh_Icon_Link() . "\n"; } if ($port->{'date_added'} > Time() - 3600 * 24 * $this->DaysMarkedAsNew) { $MarkedAsNew = "Y"; $HTML .= freshports_New_Icon() . "\n"; } if ($this->ShowEverything || $this->ShowWatchListCount) { $HTML .= ' ' . freshPorts_WatchListCount_Icon_Link() . '=' . $port->WatchListCount(); } $HTML .= ' ' . freshports_Search_Depends_All($port->category . '/' . $port->port); # if this port is, or every has been, vulnerable, display the right skull # and a link to the list of all such vulnerabilities if ($port->IsVulnerable() || $port->WasVulnerable()) { $HTML .= ' ' . freshports_VuXML_Link($port->package_name, $port->IsVulnerable()); } # search for bugs related to this port $HTML .= ' ' . freshports_Search_For_Bugs($port->category . '/' . $port->port); # report a bug related to this port $HTML .= ' ' . freshports_Report_A_Bug($port->category . '/' . $port->port); $HTML .= "</DT>\n<DD>"; # show forbidden and broken if ($port->forbidden) { $HTML .= freshports_Forbidden_Icon_Link($port->forbidden) . ' FORBIDDEN: ' . htmlify(_forDisplay($port->forbidden)) . "<br>"; } if ($port->broken) { $HTML .= freshports_Broken_Icon_Link($port->broken) . ' BROKEN: ' . htmlify(_forDisplay($port->broken)) . "<br>"; } if ($port->deprecated) { $HTML .= freshports_Deprecated_Icon_Link($port->deprecated) . ' DEPRECATED: ' . htmlify(_forDisplay($port->deprecated)) . "<br>"; } if ($port->expiration_date) { if (date('Y-m-d') >= $port->expiration_date) { $HTML .= freshports_Expired_Icon_Link($port->expiration_date) . ' This port expired on: ' . $port->expiration_date . '<br>'; } else { $HTML .= freshports_Expiration_Icon_Link($port->expiration_date) . ' EXPIRATION DATE: ' . $port->expiration_date . '<br>'; } } if ($port->ignore) { $HTML .= freshports_Ignore_Icon_Link($port->ignore) . ' IGNORE: ' . htmlify(_forDisplay($port->ignore)) . "<br>"; } if ($port->restricted) { $HTML .= freshports_Restricted_Icon_Link($port->restricted) . ' RESTRICTED: ' . htmlify(_forDisplay($port->restricted)) . '<br>'; } if ($port->no_cdrom) { $HTML .= freshports_No_CDROM_Icon_Link($port->no_cdrom) . ' NO CDROM: ' . htmlify(_forDisplay($port->no_cdrom)) . '<br>'; } if ($port->is_interactive) { $HTML .= freshports_Is_Interactive_Icon_Link($port->is_interactive) . ' IS INTERACTIVE: ' . htmlify(_forDisplay($port->is_interactive)) . '<br>'; } // maintainer if ($port->maintainer && ($this->ShowMaintainedBy || $this->ShowEverything)) { if (strtolower($port->maintainer) == UNMAINTAINTED_ADDRESS) { $HTML .= '<br>There is no maintainer for this port.<br>'; $HTML .= 'Any concerns regarding this port should be directed to the FreeBSD ' . 'Ports mailing list via '; $HTML .= '<A HREF="' . MAILTO . ':' . freshportsObscureHTML($port->maintainer); $HTML .= '?subject=FreeBSD%20Port:%20' . $port->category . '/' . $port->port . '" TITLE="email the FreeBSD Ports mailing list">'; $HTML .= freshportsObscureHTML($port->maintainer) . '</A>'; } else { $HTML .= '<b>'; $HTML .= 'Maintainer:</b> <A HREF="' . MAILTO . ':' . freshportsObscureHTML($port->maintainer); $HTML .= '?subject=FreeBSD%20Port:%20' . $port->category . '/' . $port->port . '" TITLE="email the maintainer">'; $HTML .= freshportsObscureHTML($port->maintainer) . '</A>'; } $HTML .= ' ' . freshports_Search_Maintainer($port->maintainer) . '<br>'; } // last commit date if (($this->ShowLastCommitDate || $this->ShowEverything) && $port->last_commit_date) { $HTML .= '<b>Last commit date:</b> ' . FormatTime($port->last_commit_date, 0, "Y-m-d H:i:s") . '<br>'; } // there are only a few places we want to show the last change. // therefore, we do not check ShowEverything here if ($this->ShowLastChange) { if ($port->updated != 0) { $HTML .= 'last change committed by ' . freshports_CommitterEmailLink($port->committer); // separate lines in case committer is null $HTML .= ' ' . freshports_Search_Committer($port->committer); $HTML .= ' on <font size="-1">' . $port->updated . '</font>' . "\n"; $HTML .= freshports_Email_Link($port->message_id); if ($port->EncodingLosses()) { $HTML .= ' ' . freshports_Encoding_Errors_Link(); } $HTML .= ' ' . freshports_Commit_Link($port->message_id); $HTML .= ' ' . freshports_Commit_Link_Port($port->message_id, $port->category, $port->port); global $freshports_CommitMsgMaxNumOfLinesToShow; $HTML .= freshports_PortDescriptionPrint($port->update_description, $port->encoding_losses, $freshports_CommitMsgMaxNumOfLinesToShow, freshports_MoreCommitMsgToShow($port->message_id, $freshports_CommitMsgMaxNumOfLinesToShow)); } else { $HTML .= "no changes recorded in FreshPorts<br>\n"; } } # show the date added, if asked if ($this->ShowDateAdded || $this->ShowEverything) { $HTML .= '<b>Port Added:</b> <font size="-1">'; if ($port->date_added) { $HTML .= $port->date_added; } else { $HTML .= "unknown"; } $HTML .= '</font><BR>' . "\n"; } $HTML .= PeopleWatchingThisPortAlsoWatch($this->db, $port->element_id); if ($port->categories) { // remove the primary category and remove any double spaces or trailing/leading spaces // this ensures that explode gives us the right stuff if (isset($port->category_looking_at)) { $CategoryToRemove = $port->category_looking_at; } else { $CategoryToRemove = $port->category; } $Categories = str_replace($CategoryToRemove, '', $port->categories); $Categories = str_replace(' ', ' ', $Categories); $Categories = trim($Categories); if ($Categories) { $HTML .= "<b>Also Listed In:</b> "; $CategoriesArray = explode(" ", $Categories); $Count = count($CategoriesArray); for ($i = 0; $i < $Count; $i++) { $Category = $CategoriesArray[$i]; # $CategoryID = freshports_CategoryIDFromCategory($Category, $this->db); # if ($CategoryID) { # // this is a real category $HTML .= '<a href="/' . $Category . '/">' . $Category . '</a>'; # } else { # $HTML .= $Category; # } if ($i < $Count - 1) { $HTML .= " "; } } $HTML .= "<br>\n"; } } $HTML .= '<b>License:</b> '; if ($port->license) { $HTML .= htmlentities($port->license); } else { $HTML .= 'not specified in port'; } $HTML .= "<br>\n"; # The ad goes here if ($this->ShowAd || $this->ShowEverything) { $HTML .= port_display_AD; } if ($this->ShowDescriptionLong || $this->ShowEverything) { $HTML .= '<PRE CLASS="code">' . htmlify(_forDisplay($port->long_description)) . '</PRE>'; } if ($this->ShowChangesLink || $this->ShowEverything) { # we want something like # http://svn.freebsd.org/ports/head/x11-wm/awesome/ $HTML .= '<a href="http://' . $port->svn_hostname . $port->element_pathname . '/">SVNWeb</a>'; } if ($port->PackageExists() && ($this->ShowPackageLink || $this->ShowEverything)) { // package $HTML .= ' <b>:</b> '; $HTML .= '<A HREF="' . FRESHPORTS_FREEBSD_FTP_URL . '/' . freshports_PackageVersion($port->version, $port->revision, $port->epoch); $HTML .= '.tgz">Package</A>'; } if ($port->homepage && ($this->ShowHomepageLink || $this->ShowEverything)) { $HTML .= ' <b>:</b> '; $HTML .= '<a HREF="' . _forDisplay($port->homepage) . '" TITLE="Homepage for this port">Homepage</a>'; } if (defined('DISTFILESSURVEYSHOW') && ($this->ShowDistfilesSurveyLink || $this->ShowEverything)) { $HTML .= ' <b>:</b> ' . freshports_DistFilesSurveyURL($port->category, $port->port); } if (defined('PORTSMONSHOW') && ($this->ShowPortsMonLink || $this->ShowEverything)) { $HTML .= ' <b>:</b> ' . freshports_PortsMonitorURL($port->category, $port->port); } if ($this->ShowEverything || $this->ShowMasterSlave) { # # Display our master port # $MasterSlave = new MasterSlave($port->dbh); $NumRows = $MasterSlave->FetchByMaster($port->category . '/' . $port->port); if ($port->IsSlavePort() || $NumRows > 0) { $HTML .= "\n<hr>\n"; } if ($port->IsSlavePort()) { $HTML .= '<dl><dt><b>Master port:</b> '; list($MyCategory, $MyPort) = explode('/', $port->master_port); $HTML .= freshports_link_to_port($MyCategory, $MyPort); $HTML .= "</dt>\n"; $HTML .= "</dl>\n"; } # # Display our slave ports # if ($NumRows > 0) { $HTML .= '<span class="slaveports">Slave ports</span>' . "\n" . '<ol class="slaveports" id="slaveports">'; for ($i = 0; $i < $NumRows; $i++) { $MasterSlave->FetchNth($i); $HTML .= '<li>' . freshports_link_to_port($MasterSlave->slave_category_name, $MasterSlave->slave_port_name) . '</li>'; } $HTML .= "</ol>\n"; } } if ($this->ShowDepends || $this->ShowEverything) { if ($port->depends_build || $port->depends_run || $port->depends_lib) { $HTML .= '<hr><p><big>NOTE: FreshPorts displays only information on required and default dependencies. Optional dependencies are not covered.</big></p>'; } if ($port->depends_build) { $HTML .= '<span class="required">Build dependencies:</span>' . "\n" . '<ol class="required" id="requiredtobuild">'; $HTML .= freshports_depends_links($this->db, $port->depends_build); $HTML .= "\n</ol>\n"; } if ($port->depends_run) { $HTML .= '<span class="required">Runtime dependencies:</span>' . "\n" . '<ol class="required" id="requiredtorun">'; $HTML .= freshports_depends_links($this->db, $port->depends_run); $HTML .= "\n</ol>\n"; } if ($port->depends_lib) { $HTML .= '<span class="required">Library dependencies:</span>' . "\n" . '<ol class="required" id="requiredlibraries">'; $HTML .= freshports_depends_links($this->db, $port->depends_lib); $HTML .= "\n</ol>\n"; } if ($port->fetch_depends) { $HTML .= '<span class="required">Fetch dependencies:</span>' . "\n" . '<ol class="required" id="requiredfetches">'; $HTML .= freshports_depends_links($this->db, $port->fetch_depends); $HTML .= "\n</ol>\n"; } if ($port->patch_depends) { $HTML .= '<span class="required">Patch dependencies:</span>' . "\n" . '<ol class="required" id="requiredpatches">'; $HTML .= freshports_depends_links($this->db, $port->patch_depends); $HTML .= "\n</ol>\n"; } if ($port->extract_depends) { $HTML .= '<span class="required">Extract dependencies:</span>' . "\n" . '<ol class="required" id="requiredextracts">'; $HTML .= freshports_depends_links($this->db, $port->extract_depends); $HTML .= "\n</ol>\n"; } # XXX when adding new depends above, be sure to update the array in ShowDependencies() $HTML .= $this->ShowDependencies($port); } # only show if we're meant to show, and if the port has not been deleted. if ($this->ShowPackageLink || $this->ShowEverything) { $HTML .= "\n<hr>\n"; if ($port->IsDeleted()) { $HTML .= '<p>No installation instructions: this port has been deleted.</p>'; $HTML .= '<p>The package name of this deleted port was: <code class="code">' . $port->latest_link . '</code></p>'; } else { $HTML .= '<p><b>To install <a href="/faq.php#port" TITLE="what is a port?">the port</a>:</b> <code class="code">cd /usr/ports/' . $port->category . '/' . $port->port . '/ && make install clean</code><br>'; if (isset($port->no_package) && $port->no_package != '') { $HTML .= '<p><b>No <a href="/faq.php#package" TITLE="what is a package?">package</a> is available:</b> ' . $port->no_package . '</p>'; } else { if ($port->forbidden || $port->broken || $port->ignore || $port->restricted) { $HTML .= '<p><b>A <a href="/faq.php#package" TITLE="what is a package?">package</a> is not available for ports marked as: Forbidden / Broken / Ignore / Restricted</b></p>'; } else { $HTML .= '<b>To add the <a href="/faq.php#package" TITLE="what is a package?">package</a>:</b> <code class="code">pkg install ' . $port->category . '/' . $port->port . '</code></p>'; } } } $HTML .= "\n<hr>\n"; } if ($this->ShowDescriptionShort && ($this->ShowDescriptionLink || $this->ShowEverything)) { // Long description $HTML .= '<A HREF="/' . $port->category . '/' . $port->port . '/">Description</a>'; $HTML .= ' <b>:</b> '; } if ($this->ShowEverything) { $HTML .= "<b>Configuration Options</b>\n<pre>"; if ($port->showconfig) { $HTML .= $port->showconfig; } else { $HTML .= ' No options to configure'; } $HTML .= "</pre>\n<hr>\n"; } if ($this->ShowEverything && $port->uses) { $HTML .= "<b>USES:</b>\n<pre>"; $HTML .= $port->uses; $HTML .= "</pre>\n<hr>\n"; } if ($this->ShowEverything || $this->ShowMasterSites) { $HTML .= '<b>Master Sites:</b>' . "\n" . '<ol class="mastersites" id="mastersites">' . "\n"; $MasterSites = explode(' ', $port->master_sites); asort($MasterSites); foreach ($MasterSites as $Site) { $HTML .= '<li>' . htmlify(_forDisplay($Site)) . "</li>\n"; } $HTML .= "</ol>\n"; # $HTML .= '<br>'; } # $HTML .= "\n<hr>\n"; $HTML .= "\n</DD>\n"; $HTML .= "</DL>\n"; return $HTML; }
echo $color['dark']; ?> "><?php echo $h2_; ?> ERRORS / FAILURES:<?php echo $_h2; ?> </th> </tr> <?php $prevclass = ''; foreach ($result->getTests() as $testcase) { foreach (array_merge($testcase->getErrors(), $testcase->getFailures()) as $error) { // Replace newlines with <br/> $content = htmlify($error->getContent()); // Split up error info preg_match_all('#((\\w+)::test\\w+)(.+)#', $content, $matches, PREG_PATTERN_ORDER); $testclass_testname = $matches[1][0]; $testclass = $matches[2][0]; // Trim all <br />'s at start of string $rest_contents = preg_replace('#(?i)^(?:<br ?\\/>)*#', '', $matches[3][0]); // Make URLs clickable $rest_contents = auto_link_text($rest_contents); if ($testclass != $prevclass) { $prevclass = $testclass; ?> <tr> <td align="left" bgcolor="<?php echo $color['medium']; ?>
function testdescriptionTxtFile($filename_txt) { $handle = fopen($filename_txt, "r"); // HTML-ify and get testdescription $testdescription = htmlify(fread($handle, filesize($filename_txt))); // Replace URLs with actual links $testdescription = auto_link_text($testdescription); fclose($handle); }
<div id="cite"> <p><?php echo htmlify($cite->getText()); ?> </p> <p> <em> <?php echo htmlify($cite->getAuthor()); ?> <?php if ($cite->hastitle()) { ?> (<?php echo htmlify($cite->getTitle()); ?> ) <?php } ?> </em> </p> </div> <?php if (!isAjax()) { ?> <?php include 'inc/backlink.html'; ?>
$(window).load(pp.load); </script> <style> label IMG { height: 24px; vertical-align: middle; } </style> <?php if ($entry->id) { ?> <h2><?php echo htmlify("{$entry->name}"); ?> </h2> <?php } else { ?> <h2>New Entry</h2> <?php } ?> <form id="entry_form" class="basic_form" enctype="multipart/form-data" method="POST" action="<?php echo $entry->id ? site_url("/entries/update/{$entry->id}") : site_url("/entries/create"); ?> "> <p class="required"> = required</p>
$req = 0; luminous::set('format', $inline ? 'html_inline' : 'html'); foreach ($samples as $s) { $formatter = luminous::formatter(); $formatter->line_numbers = true; $formatter->link = true; // At the moment, this just stops TARGET attributes on links, which happen // to be highly convenient but the w3c in their infinite wisdom decided // were invalid in HTML4 strict. $formatter->strict_standards = true; $src = file_get_contents($s); $output = $formatter->format($src); $out[$s] = array(); foreach ($doctypes_ as $spec) { $doctype = $doctypes[$spec]; $html = @htmlify($output, $doctype); try { $return = validate($html); } catch (Exception $e) { echo "Failed to connect or some other problem\n"; echo "{$e->message}\n"; $out[$s][$spec]['problems'] = array(); $out[$s][$spec]['problems'][] = $e->message; continue; } if (isset($out[$s][$spec]['problems'])) { continue; } if ($return == false) { $out[$s][$spec]['problems'] = array('Validator returned false'); continue;
<name><?php echo htmlify($entry->name, false); ?> </name> <description><![CDATA[ <?php echo $entry->descriptionSummary; ?> <br/> <?php echo link_to($entry, 'show', 'Click for details'); ?> ]]></description> <address> <?php echo htmlify($entry->address, false); ?> </address> <Point> <coordinates><?php echo $entry->geocode; ?> </coordinates> </Point> </Placemark> <?php } ?> </Document> </kml>
<span class="action <?php echo $comment->action; ?> ">(<?php echo $comment->action; ?> request)</span> <?php } ?> <?php if (isset($edit_ui) && $edit_ui) { ?> <a class="delete_button" class="button" href="#" onclick="deleteComment(<?php echo $comment->id; ?> )">delete</a> <?php } ?> </div> <div class="body"><?php echo linkify(htmlify($comment->body)); ?> </div> </li> <?php } ?> </ul>
function wikify($content) { $content = htmlify($content, false); $content = preg_replace('#\\[\\[([\\w ]+);([\\w ]+)?\\]\\]#', '<a href = "wpage.php?title=$1">$2</a>', $content); $content = preg_replace('#\\[\\[([\\w ]+)\\]\\]#', '<a href = "wpage.php?title=$1">$1</a>', $content); $matches = array('#\\[url\\=(http://.*?)\\](.*?)\\[/url\\]#', '#\\[email:([\\w\\. ]+);([\\w\\@\\.]+)\\]#', '#funcFullArticle\\(([\\w ]+)\\)#', '#\\_([\\w ]+)\\_#', '#\\*([\\w \\d\\p{P}]+)\\*#', '#-([\\w \\&]+)-#', '#^=([\\w?\'\\"\\(\\)\\\\.,/ \\&]+)=#m', '#\\[img\\.(\\d+)\\](.+)\\[\\/img\\]#', '#\\[img\\](.+)\\[\\/img\\]#', '#\\|-([^\\|]+)#sm', '#{.(.+?).}#sm', '#^\\!(.+?)\\n#m', '#\\%(.+?)\\n#', '#\\[list\\]#', '#\\[\\/list\\]#', '#\\n-([\\w \\p{P}]+)#', '#\\[center\\]#', '#\\[\\/center\\]#', '#\\[space\\]#', '#\\[br\\]#'); $replacements = array('<a href = "$1" class = "external" title = "This is an external link.">$2</a>', '<a href = "mailto:$2" class = "external" title = "This is an email address.">$1</a>', '<span class = "subtle">The following is a snippit, there is a full article available: <a href = "wiki.php?title=$1">$1</a>.</span><br />', '<em>$1</em>', '<b>$1</b>', '<del>$1</del>', '<h3>$1</h3>' . "\n", '<img src = "$2" width = "$1" alt = "unknown" />', '<img src = "$1" alt = "unknown" />', '<tr>\\1</tr>', '<table>\\1</table>', '<td>\\1</td>', '<th>\\1</th>', '<ul>', '</ul>', '<li>\\1</li>', '<div class = "centered">', '</div>', ' ', '<br />'); $content = preg_replace($matches, $replacements, $content); while (strpos($content, 'imgPromo') !== FALSE) { $img = Galleries::getRandomImage(); $rep = '<a href = "viewGalleryImage.php?filename=' . $img['filename'] . '&galleryId=' . $img['galleryId'] . '"><img src = "' . $img['fullPath'] . '" width = "$1" alt = "unknown"></a>'; $content = preg_replace('#\\[imgPromo\\.(\\d+)\\]#', $rep, $content, 1); } return $content; }
<pre> <?php print htmlify(htmlspecialchars($str), true); ?> </pre> <p> The following should not get a PR type hyperlink: <?php echo htmlify("http://www.postgresql.org/docs/8.2/static/release-8-2-2.html", false); ?> <h2> Other links to check</h2> <ul> <li>Ensure all PRs are HTMLified: <a href="/databases/postgresql7/files.php?message_id=200302062046.h16KkqNv024036@repoman.freebsd.org">/databases/postgresql7/files.php?message_id=200302062046.h16KkqNv024036@repoman.freebsd.org</a> <li>Good test page: <a href="/lang/php4/">/lang/php4/</a> </ul> <h2>Does it htmlify the URL and the URL name?</h2> <ul> <li>Before: http://www.sql-ledger.org/cgi-bin/nav.pl?page=news.html&title=What's%20New <li>After: <?php echo htmlify("http://www.sql-ledger.org/cgi-bin/nav.pl?page=news.html&title=What's%20New"); ?> </ul> </body> </html>
break; case 'delete': if (!Session::hasPriv('NEWS_DELETE')) { throw new PermissionException(); } $id = intval($_REQUEST['id']); $sql = 'DELETE FROM news WHERE id = :id '; $stmt = $db->prepare($sql); $stmt->bindValue(':id', $id); $stmt->execute(); logAndRedirect('news.php', 'News deleted: ' . $id); break; default: require_once 'includes/widgets/header.php'; require_once 'includes/widgets/sidebar.php'; $news = new News(); $news->setCount(10); while ($article = $news->getNext()) { startBox(); echo '<p><span class = "subtle">Posted on ' . formatDt(new DateTime($article['date'])) . ' by <a href = "profile.php?id=' . $article['author'] . '">' . $article['username'] . '</a>.</span></p>'; echo htmlify($article['content']); if (Session::hasPriv('NEWS_DELETE')) { echo '<dl class = "subtle">'; echo '<dt><a href = "news.php?action=delete&id=' . $article['id'] . '">Delete</a></dt>'; echo '<dt><a href = "news.php?action=edit&id=' . $article['id'] . '">Edit</a></dt>'; echo '</dl>'; } stopBox(htmlify($article['title'], false)); } } require_once 'includes/widgets/footer.php';
<h2 id="csrf">CSRF</h2> <p>To enable CSRF protection you need to extend <code>Form</code>. This will ensure the token is present on all forms (using a special hidden called <code>csrf_token</code>). The developer must validate the token when POSTing the form.</p> <?php display('overview/csrf.php'); ?> <?php htmlify('overview/csrf.php'); ?> <h2 id="methods">HTTP Methods (REST verbs)</h2> <p>To support other methods than <tt>GET</tt> and <tt>POST</tt> <code>Form</code> inserts a hidden field <code>_method</code> and uses POST to submit.</p> <?php display('overview/methods.php'); ?> <?php htmlify('overview/methods.php'); ?> <table class="table table-striped table-condensed" style="width: auto;"> <thead> <tr><th>Method</th><th>Submitted as</th><th>_method</th></tr> </thead> <tbody> <tr><td>GET</td><td>GET</td><td>unset</td></tr> <tr><td>POST</td><td>POST</td><td>unset</td></tr> <tr><td>PATCH</td><td>POST</td><td>PATCH</td></tr> <tr><td>DELETE</td><td>POST</td><td>DELETE</td></tr> </tbody> <tfoot> <tr><td colspan="4">... and so on.</td></tr> </tfoot> </table>
function pb_add_servise($user_id) { $current_date = date("F j, Y, g:i:s a"); $exp = fDate(date("Y-m-d"), '+6 month'); $about = htmlify($_POST['about']); $service_id = pb_new_id('pb_services', 'service_id', 10, 'numbers'); return pb_db("INSERT INTO pb_services (service_id, category, title, cost, location, hours, established, expires, bio, cover, logo, owner, members, ratings, portfolio, status) \n\t\t\t\tVALUES ('{$service_id}', '{$_POST['category']}', '{$_POST['title']}', '{$_POST['cost']}', '{$_POST['location']}', '', '{$current_date}', '{$exp}', '{$about}', '{$_POST['profile_cover']}', '{$_POST['profile_img']}', '{$user_id}', '', '', '{$_POST['profile_logo']}', 'open')"); }
?> -source" class="panel-collapse collapse" role="tabpanel"><div class="panel-body"><?php display($filename); ?> </div></div> </div> <div class="panel panel-default"> <div class="panel-heading" role="tab"><h4 class="panel-title"><a role="button" data-toggle="collapse" href="#example<?php echo $n; ?> -html">View output html</a></h4></div> <div id="example<?php echo $n; ?> -html" class="panel-collapse collapse" role="tabpanel"><div class="panel-body"><?php htmlify($filename); ?> </div></div> </div> </div> </div> </div> <?php } ?> </div> <?php include 'badge.php'; ?> <script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
function weblink($url, $text = null) { if (!$text) { $text = $url; } if (!preg_match('|^http|', $url)) { $url = "http://{$url}"; } return "<a href=\"{$url}\" rel=\"nofollow\"" . ">" . htmlify($text) . "</a>"; }
function update_eventitem_labs($record, $newid, $conn) { $succ = TRUE; if ($record["PC_CATEG"]) { $succ = $succ && sql_query("UPDATE eventitems SET eventCateg = '" . sql_real_escape_string($record["PC_CATEG"]) . "' WHERE eventId = '{$newid}'", $conn); } if ($record["LabName"]) { $succ = $succ && sql_query("UPDATE eventitems SET eventTitle = '" . sql_real_escape_string($record["LabName"]) . "' WHERE eventId = '{$newid}'", $conn); } if ($record["LabLogoURL"]) { $succ = $succ && sql_query("UPDATE eventitems SET eventThumbnail = '" . sql_real_escape_string($record["LabLogoURL"]) . "' WHERE eventId = '{$newid}'", $conn); } if ($record["LabAcronym"]) { $succ = $succ && sql_query("UPDATE eventitems SET secondLine = '" . sql_real_escape_string($record["LabAcronym"]) . "' WHERE eventId = '{$newid}'", $conn); } if ($record["AOIKeys"]) { $succ = $succ && sql_query("UPDATE eventitems SET broadcastInFeeds = '" . sql_real_escape_string($record["AOIKeys"]) . "' WHERE eventId = '{$newid}'", $conn); } $eventDetails = ""; if ($record["LabDescription"]) { $eventDetails .= "<h2>Description</h2><p>" . htmlify($record["LabDescription"]) . "</p>"; } $labDirector = ""; if ($record["LabDirector"]) { $labDirector = $record["LabDirector"]; if ($record["DIRECTOR_PC_ID"]) { $labDirector = "<a href=\"pocketcampus://events.plugin.pocketcampus.org/showEventItem?eventItemId=" . rawurlencode($record["DIRECTOR_PC_ID"]) . "\">" . $labDirector . "</a>"; } $eventDetails .= "<h2>Director</h2><p>{$labDirector}</p>"; } if ($record["ATTENDING_MEMBERS_NAMES"]) { $authors = array_map("trim", explode(",", $record["ATTENDING_MEMBERS_NAMES"])); if ($record["ATTENDING_MEMBERS_IDS"]) { $author_map = array_map("rawurlencode", array_map("trim", explode(",", $record["ATTENDING_MEMBERS_IDS"]))); if (count($authors) == count($author_map)) { for ($i = 0; $i < count($author_map); $i++) { if ($author_map[$i]) { $authors[$i] = "<a href=\"pocketcampus://events.plugin.pocketcampus.org/showEventItem?eventItemId={$author_map[$i]}\">{$authors[$i]}</a>"; } } } } if ($labDirector) { $authors = array_diff($authors, array($labDirector)); } $authors = array_map("make_li", $authors); if (count($authors)) { $eventDetails .= "<h2>Attending Members</h2><p>" . implode("", $authors) . "</p>"; } } if ($record["LabHomepageURL"]) { $eventDetails .= "<h2>Homepage</h2><p><a href=\"{$record["LabHomepageURL"]}\">Link</a></p>"; } if ($eventDetails) { $succ = $succ && sql_query("UPDATE eventitems SET eventDetails = '" . sql_real_escape_string($eventDetails) . "' WHERE eventId = '{$newid}'", $conn); } return $succ; }
function printSubStages($dir) { global $img; global $stage; global $stageout_cfg; global $current_stage_root; global $last_stage_root; $substageNo = 0; $parentStage = $stage; $first = true; $subs = glob("{$dir}/*", GLOB_ONLYDIR | GLOB_NOSORT); usort($subs, "filedatecompare"); foreach ($subs as $stagedir) { if ($first) { echo "<table style=\"width: 100%\">\n"; $first = false; } $substageNo++; $stage = $parentStage . "_" . $substageNo; $stageName = file_get_contents("{$stagedir}/stagename.txt"); if (file_exists("{$stagedir}/result.txt")) { $cur_res = file_get_contents("{$stagedir}/result.txt"); $diff = 0; if (substr($stagedir, 0, strlen($current_stage_root)) == $current_stage_root) { $last_stage_dir = substr_replace($stagedir, $last_stage_root, 0, strlen($current_stage_root)); if (file_exists("{$last_stage_dir}/result.txt")) { $last_res = file_get_contents("{$last_stage_dir}/result.txt"); $diff = abs($cur_res) - abs($last_res); } else { echo "<!-- {$last_stage_dir} " . file_exists("{$last_stage_dir}/result.txt") . " {$last_res} -->"; } } $stageresult = htmlForResult($cur_res, $diff); $display_style = displayStyleForResult(file_get_contents("{$stagedir}/result.txt")); } else { $stageresult = htmlForResult("", 0); $display_style = displayStyleForResult(""); } $stageStack = explode("/", $stageName); if (file_exists("{$stagedir}/stagelink.txt")) { $stagelink = file_get_contents("{$stagedir}/stagelink.txt"); $stageHtml = "<a href=\"{$stagelink}\">" . end($stageStack) . "</a>"; } else { $stageHtml = end($stageStack); } echo " <tr><td>" . $stageHtml . "</td><td>" . $stageresult . "</td><td>"; echo " <div style=\"display:inline;cursor:pointer;\" onclick=\"document.getElementById('stageout" . $stage . "').style.display='inline'\"><img src=\"{$img}/Plus_sign.png\" width=\"16\" height=\"16\" alt=\"show details\"/></div>\n"; echo " <div style=\"display:inline;cursor:pointer;\" onclick=\"document.getElementById('stageout" . $stage . "').style.display='none'\"><img src=\"{$img}/Minus_sign.png\" width=\"16\" height=\"16\" alt=\"hide details\"/></div>\n"; echo " </td></tr>\n"; echo " <tr><td colspan=\"3\"><div style=\"display:" . $display_style . "\" id=\"stageout" . $stage . "\">"; echo " <div class=\"substage\">"; printSubStages($stagedir); echo " </div>"; echo " <p class=\"cmd\">" . htmlify(file_get_contents("{$stagedir}/cmd.txt")) . "</p>\n"; echo " <p class=\"out\">" . htmlify(file_get_contents("{$stagedir}/out.txt")) . "</p>\n"; echo " <p class=\"err\">" . htmlify(file_get_contents("{$stagedir}/err.txt")) . "</p>\n"; // todo: improve info div (print duration as time) // todo: print summary (#of failed, #of warns and #of oks /* echo " <div class=\"info\">\n"; */ /* echo " Start: " . file_get_contents("$stagedir/start.txt") . "\n"; */ /* echo " End: " . file_get_contents("$stagedir/end.txt") . "\n"; */ /* echo " </div>\n"; */ echo " </div></td></tr>"; echo " \n"; } if (!$first) { echo "</table>\n"; } }
.ogg" /></video>') .appendTo('#video-<?php echo $testcase->getClassName(); ?> '); } }); <?php // Add assertions, failures and errors to stacktrace $stacktrace = 'Assertions: ' . $testcase->getNumberOfAssertions() . ' Failures: ' . $testcase->getNumberOfFailure() . ' Errors: ' . $testcase->getNumberOfErrors(); foreach ($testcase->getErrors() as $error) { $stackstring = htmlify($error->getContent()); $stacktrace = $stacktrace . '<br/>####################################################<br/>## <b>ERROR:</b> ' . $error->getType() . '<br/>####################################################<br/>' . auto_link_text($stackstring); } foreach ($testcase->getFailures() as $failure) { $stackstring = htmlify($failure->getContent()); $stacktrace = $stacktrace . '<br/>####################################################<br/>## <b>FAILURE:</b> ' . $failure->getType() . '<br/>####################################################<br/>' . auto_link_text($stackstring); } // Generate line numbers to use next to source code for easy to find failures and errors $linenumbers = ''; for ($i = 1; $i <= $testcase->getSourcecodeNumberOfLines(); $i++) { // Color red if there is an error on this line $screenshot = $testcase->getScreenshotOnLine($i); if ($testcase->lineHasError($i)) { $linenumbers .= '<font style="BACKGROUND-COLOR: red" color="white">'; if ($screenshot) { $linenumbers .= '<a class="single_image" rel="group-' . $testcase->getClassName() . '" href="' . $result->getTestsDirectoryRelative() . $screenshot . '">'; } $linenumbers .= $i; if ($screenshot) { $linenumbers .= '</a>';
function CreateHTML() { global $freshports_CommitMsgMaxNumOfLinesToShow; $Debug = 0; if (!$this->result) { syslog(LOG_ERR, __FILE__ . '::' . __LINE__ . ': no result set supplied'); die("read from database failed"); exit; } $NumRows = pg_numrows($this->result); if ($this->Debug) { echo __FILE__ . ':' . __LINE__ . " Number of rows = {$NumRows}<br>\n"; } if (!$NumRows) { $this->HTML = "<TR><TD>\n<P>Sorry, nothing found in the database....</P>\n</td></tr>\n"; return $this->HTML; } # if we have a UserID, but no flagged commits, grab them # if ($this->UserID && !isset($this->FlaggedCommits)) { require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/commit_flag.php'; $FlaggedCommits = new CommitFlag($this->dbh); $NumFlaggedCommits = $FlaggedCommits->Fetch($this->UserID); for ($i = 0; $i < $NumFlaggedCommits; $i++) { $FlaggedCommits->FetchNth($i); $this->FlaggedCommits[$FlaggedCommits->commit_log_id] = $FlaggedCommits->commit_log_id; if ($this->Debug) { echo "fetching record # {$i} -> {$FlaggedCommits->commit_log_id}<br>"; } } } $GlobalHideLastChange = "N"; $this->HTML = ""; # leave it all empty as a comparison point $PreviousCommit = new CommitRecord(); $NumberOfPortsInThisCommit = 0; $MaxNumberPortsToShow = 10; $TooManyPorts = false; # we might not show all of a commit, just for the really big ones. for ($i = 0; $i < $NumRows; $i++) { $myrow = pg_fetch_array($this->result, $i); if ($Debug) { echo 'processing row ' . $i . ' ' . $myrow['commit_log_id'] . ' ' . $myrow['message_id'] . "<br>\n"; } unset($mycommit); $mycommit = new CommitRecord(); $mycommit->PopulateValues($myrow); // OK, while we have the log change log, let's put the port details here. if ($mycommit->commit_log_id != $PreviousCommit->commit_log_id) { if ($NumberOfPortsInThisCommit > $MaxNumberPortsToShow && !$this->ShowAllPorts) { $this->HTML .= '<BR>' . freshports_MorePortsToShow($PreviousCommit->message_id, $NumberOfPortsInThisCommit, $MaxNumberPortsToShow); } $TooManyPorts = false; if ($i > 0) { $this->HTML .= "\n<BLOCKQUOTE>"; $this->HTML .= freshports_CommitDescriptionPrint($PreviousCommit->commit_description, $PreviousCommit->encoding_losses, $Lines, freshports_MoreCommitMsgToShow($PreviousCommit->message_id, $Lines)); # close off the previous commit first $this->HTML .= "\n</BLOCKQUOTE>\n</TD></TR>\n\n\n"; } # count the number of ports in this commit. # first time into the loop, this will be executed. $NumberOfPortsInThisCommit = 0; $MaxNumberPortsToShow = 10; if ($mycommit->commit_date != $PreviousCommit->commit_date) { $this->HTML .= '<TR><TD COLSPAN="3" BGCOLOR="' . BACKGROUND_COLOUR . '" HEIGHT="0">' . "\n"; $this->HTML .= ' <FONT COLOR="#FFFFFF"><BIG>' . FormatTime($mycommit->commit_date, 0, "D, j M Y") . '</BIG></FONT>' . "\n"; $this->HTML .= '</TD></TR>' . "\n\n"; } global $freshports_mail_archive; $this->HTML .= "<TR><TD>\n"; $this->HTML .= '<SMALL>'; $this->HTML .= '[ ' . $mycommit->commit_time . ' ' . freshports_CommitterEmailLink($mycommit->committer) . ' ]'; $this->HTML .= '</SMALL>'; $this->HTML .= ' '; $this->HTML .= freshports_Email_Link($mycommit->message_id); $this->HTML .= ' '; if ($this->UserID) { if (isset($this->FlaggedCommits[$mycommit->commit_log_id])) { $this->HTML .= freshports_Commit_Flagged_Link($mycommit->message_id); } else { $this->HTML .= freshports_Commit_Flagged_Not_Link($mycommit->message_id); } } if ($mycommit->EncodingLosses()) { $this->HTML .= ' ' . freshports_Encoding_Errors(); } if ($mycommit->stf_message != '') { $this->HTML .= ' ' . freshports_SanityTestFailure_Link($mycommit->message_id); } # echo '<pre>' . print_r($mycommit, true) . '</pre>'; if ($mycommit->svn_revision != '') { $this->HTML .= ' ' . freshports_svnweb_ChangeSet_Link($mycommit->svn_revision, $mycommit->svn_hostname, $mycommit->path_to_repo); } $this->HTML .= "<br>\n"; } $NumberOfPortsInThisCommit++; if ($NumberOfPortsInThisCommit > $MaxNumberPortsToShow && !$this->ShowAllPorts) { $TooManyPorts = true; } if (!$TooManyPorts) { if (isset($mycommit->category) && $mycommit->category != '') { if ($this->UserID) { if ($mycommit->watch) { $this->HTML .= ' ' . freshports_Watch_Link_Remove($this->WatchListAsk, $mycommit->watch, $mycommit->element_id) . ' '; } else { $this->HTML .= ' ' . freshports_Watch_Link_Add($this->WatchListAsk, $mycommit->watch, $mycommit->element_id) . ' '; } } $this->HTML .= '<BIG><B>'; $this->HTML .= '<A HREF="/' . $mycommit->category . '/' . $mycommit->port . '/">'; $this->HTML .= $mycommit->port; $this->HTML .= '</A>'; $PackageVersion = freshports_PackageVersion($mycommit->version, $mycommit->revision, $mycommit->epoch); if (strlen($PackageVersion) > 0) { $this->HTML .= ' ' . $PackageVersion; } $this->HTML .= "</B></BIG>\n"; $this->HTML .= '<A HREF="/' . $mycommit->category . '/">'; $this->HTML .= $mycommit->category . "</A>"; $this->HTML .= ' '; // indicate if this port has been removed from cvs if ($mycommit->status == "D") { $this->HTML .= " " . freshports_Deleted_Icon_Link() . "\n"; } // indicate if this port needs refreshing from CVS if ($mycommit->needs_refresh) { $this->HTML .= " " . freshports_Refresh_Icon_Link() . "\n"; } if ($mycommit->date_added > Time() - 3600 * 24 * $this->DaysMarkedAsNew) { $MarkedAsNew = "Y"; $this->HTML .= freshports_New_Icon() . "\n"; } if ($mycommit->forbidden) { $this->HTML .= ' ' . freshports_Forbidden_Icon_Link() . "\n"; } if ($mycommit->broken) { $this->HTML .= ' ' . freshports_Broken_Icon_Link() . "\n"; } if ($mycommit->deprecated) { $this->HTML .= ' ' . freshports_Deprecated_Icon_Link() . "\n"; } if ($mycommit->expiration_date) { if (date('Y-m-d') >= $mycommit->expiration_date) { $this->HTML .= freshports_Expired_Icon_Link($mycommit->expiration_date) . "\n"; } else { $this->HTML .= freshports_Expiration_Icon_Link($mycommit->expiration_date) . "\n"; } } if ($mycommit->ignore) { $this->HTML .= ' ' . freshports_Ignore_Icon_Link() . "\n"; } $this->HTML .= freshports_Commit_Link_Port($mycommit->message_id, $mycommit->category, $mycommit->port); $this->HTML .= " "; if ($mycommit->vulnerable_current) { $this->HTML .= ' ' . freshports_VuXML_Icon() . ' '; } else { if ($mycommit->vulnerable_past) { $this->HTML .= ' ' . freshports_VuXML_Icon_Faded() . ' '; } } if ($mycommit->restricted) { $this->HTML .= freshports_Restricted_Icon_Link($mycommit->restricted) . ' '; } if ($mycommit->no_cdrom) { $this->HTML .= freshports_No_CDROM_Icon_Link($mycommit->no_cdrom) . ' '; } if ($mycommit->is_interactive) { $this->HTML .= freshports_Is_Interactive_Icon_Link($mycommit->is_interactive) . ' '; } } else { # This is a non-port element... $this->HTML .= $mycommit->revision . ' '; $this->HTML .= '<big><B>'; $PathName = preg_replace('|^/?ports/|', '', $mycommit->element_pathname); # echo "'$PathName' " . "'" . $mycommit->repo_name . "'"; switch ($mycommit->repo_name) { case 'ports': $PathName = preg_replace('|^head/|', '', $PathName); break; } if ($PathName != $mycommit->element_pathname) { $this->HTML .= '<a href="/' . str_replace('%2F', '/', urlencode($PathName)) . '">' . $PathName . '</a>'; $this->HTML .= "</B></BIG>\n"; } else { $this->HTML .= '<a href="' . FRESHPORTS_FREEBSD_CVS_URL . $PathName . '#rev' . $mycommit->revision . '">' . $PathName . '</a>'; $this->HTML .= "</B></BIG>\n"; } } $this->HTML .= htmlify(_forDisplay($mycommit->short_description)) . "\n"; $this->HTML .= "<BR>\n"; global $freshports_CommitMsgMaxNumOfLinesToShow; if ($this->ShowEntireCommit) { $Lines = 0; } else { $Lines = $freshports_CommitMsgMaxNumOfLinesToShow; } } # !$TooManyPorts $PreviousCommit = $mycommit; } if ($NumberOfPortsInThisCommit > $MaxNumberPortsToShow && !$this->ShowAllPorts) { $this->HTML .= '<BR>' . freshports_MorePortsToShow($PreviousCommit->message_id, $NumberOfPortsInThisCommit, $MaxNumberPortsToShow); } $this->HTML .= "\n<BLOCKQUOTE>"; $this->HTML .= freshports_CommitDescriptionPrint($PreviousCommit->commit_description, $PreviousCommit->encoding_losses, $Lines, freshports_MoreCommitMsgToShow($PreviousCommit->message_id, $Lines)); # close off the last commit $this->HTML .= "\n</BLOCKQUOTE>\n</TD></TR>\n\n\n"; unset($mycommit); return $this->HTML; }