com web/php: Only render HTML for image when there is an image: conferences/index.php
| From: | Christoph Michael Becker | Date: | Thu, 30 Apr 2020 08:56:17 +0000 |
| Subject: | com web/php: Only render HTML for image when there is an image: conferences/index.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-28607@lists.php.net to get a copy of this message | ||
Commit: 640baa75da05828193acfd13196ae8dde6e0c837
Author: Sebastian Bergmann <sb@sebastian-bergmann.de> Thu, 30 Apr 2020 10:48:02
+0200
Committer: Christoph M. Becker <cmbecker69@gmx.de> Thu, 30 Apr 2020 10:56:17 +0200
Parents: 64221f5e49b5e2c7fee02d7ce9956f188132ae47
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=640baa75da05828193acfd13196ae8dde6e0c837
Log:
Only render HTML for image when there is an image
Fix issue described in https://github.com/php/web-php/pull/321#issuecomment-621647915
Changed paths:
M conferences/index.php
Diff:
diff --git a/conferences/index.php b/conferences/index.php
index 1bb5cdc55..64a2239e3 100644
--- a/conferences/index.php
+++ b/conferences/index.php
@@ -35,7 +35,11 @@ foreach($frontpage as $entry) {
$content .= '<div class="newsentry">';
$content .= '<h3 class="newstitle title"><a href="'.
$MYSITE.$link .'" name="' . $id . '">' .
$entry["title"] . '</a></h3>';
$content .= '<div class="newsimage">';
- $content .= sprintf('<a href="%s"><img
src="/images/news/%s"></a>',
$entry["newsImage"]["link"],
$entry["newsImage"]["content"]);
+
+ if (isset($entry["newsImage"])) {
+ $content .= sprintf('<a href="%s"><img
src="/images/news/%s"></a>',
$entry["newsImage"]["link"],
$entry["newsImage"]["content"]);
+ }
+
$content .= '</div>';
$content .= '<div class="newscontent">';
$content .= $entry["content"];