[web-php] master: Inline unnecessary local variables

From: Date: Tue, 28 Jun 2022 16:53:37 +0000
Subject: [web-php] master: Inline unnecessary local variables
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-30180@lists.php.net to get a copy of this message
Author: Andreas Möller (localheinz) Committer: GitHub (web-flow) Pusher: cmb69 Date: 2022-06-28T18:47:39+02:00 Commit: https://github.com/php/web-php/commit/879d41064333967d72be3f1fd26f2d9cbeb6fae0 Raw diff: https://github.com/php/web-php/commit/879d41064333967d72be3f1fd26f2d9cbeb6fae0.diff Inline unnecessary local variables Closes GH-582. Changed paths: M include/layout.inc M include/posttohost.inc Diff: diff --git a/include/layout.inc b/include/layout.inc index 7aafdc713..409f475a8 100644 --- a/include/layout.inc +++ b/include/layout.inc @@ -254,13 +254,11 @@ function clean_note($text) $text = highlight_php(trim($text), TRUE); // Turn urls into links - $text = preg_replace( + return preg_replace( '!((mailto:|(https?|ftp|nntp|news):\/\/).*?)(\s|<|\)|"|\\\\|\'|$)!', '<a href="\1" rel="nofollow" target="_blank">\1</a>\4', $text ); - - return $text; } function display_errors($errors) diff --git a/include/posttohost.inc b/include/posttohost.inc index 95d2e7899..211a3885a 100644 --- a/include/posttohost.inc +++ b/include/posttohost.inc @@ -18,7 +18,5 @@ function posttohost($url, $data) $ctx = stream_context_create(array('http' => $opts)); - $response_body = file_get_contents($url, false, $ctx); - - return $response_body; + return file_get_contents($url, false, $ctx); }

« previous php.webmaster (#30180) next »