Skip to content

Commit

Permalink
Check for null parameter in the addcslashes call.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Jul 18, 2022
1 parent 319da97 commit 17434bd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions templates/parts/markdown-hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@
echo '-------- | ---- | -----------', $eol;

foreach ( $arguments as $argument ) {
$type = $argument->get_type();
$type = $argument->get_type();
$description = $argument->get_description();

\printf(
'%s | %s | %s',
\sprintf( '`%s`', $argument->get_name() ),
empty( $type ) ? '' : \sprintf( '`%s`', \addcslashes( $type, '|' ) ),
strtr(
\addcslashes( $argument->get_description(), '|' ),
( null === $description ) ? '' : \addcslashes( $description, '|' ),
array(
"\r\n" => '<br>',
"\r" => '<br>',
Expand Down

0 comments on commit 17434bd

Please sign in to comment.