Page MenuHomeDevCentral

D2483.diff
No OneTemporary

D2483.diff

diff --git a/css/media-queries-generator.php b/css/media-queries-generator.php
--- a/css/media-queries-generator.php
+++ b/css/media-queries-generator.php
@@ -1,5 +1,5 @@
<?php
- $widths = array_key_exists('widths', $_REQUEST) ? $_REQUEST['widths'] : '400, 720, 1280, 1440, 1920, 2880';
+ $widths = $_REQUEST['widths'] ?? '400, 720, 1280, 1440, 1920, 2880';
?>
<form name="media-queries-generator" class="custom">
<div class="row collapse">
@@ -35,10 +35,10 @@
</div>
<div class="row collapse">
<div class="six columns">
- <textarea name="css" id="css" rows="16" style="width: 99%;" placeholder="The CSS content" onChange="BuildCSS();"><?= $_REQUEST['css'] ?></textarea>
+ <textarea name="css" id="css" rows="16" style="width: 99%;" placeholder="The CSS content" onChange="BuildCSS();"><?= $_REQUEST['css'] ?? "" ?></textarea>
</div>
<div class="six columns">
- <textarea name="result" id="result" rows="16" style="width: 99%;" placeholder="The final CSS will appear here."><?= $result ?></textarea>
+ <textarea name="result" id="result" rows="16" style="width: 99%;" placeholder="The final CSS will appear here."></textarea>
</div>
</div>
<div class="row">
diff --git a/finger/index.php b/finger/index.php
--- a/finger/index.php
+++ b/finger/index.php
@@ -14,7 +14,7 @@
<form>
<div class="row collapse">
<div class="ten mobile-three columns">
- <input type="text" name="user" id="user" value="<?= $_REQUEST['user'] ?>" placeholder="username@server" />
+ <input type="text" name="user" id="user" value="<?= $_REQUEST['user'] ?? "" ?>" placeholder="username@server" />
</div>
<div class="two mobile-one columns">
<input type="submit" class="button expand postfix" value="Finger" />
diff --git a/finger/thimbl_inputForm.html b/finger/thimbl_inputForm.html
--- a/finger/thimbl_inputForm.html
+++ b/finger/thimbl_inputForm.html
@@ -2,7 +2,7 @@
<form>
<div class="row collapse">
<div class="ten mobile-three columns">
- <input type="text" name="user" id="user" value="<?= $_REQUEST['user'] ?>" placeholder="username@server" />
+ <input type="text" name="user" id="user" value="<?= $_REQUEST['user'] ?? "" ?>" placeholder="username@server" />
</div>
<div class="two mobile-one columns">
<input type="submit" class="button expand postfix" value="Finger" />
diff --git a/gadgets/motd-variations.php b/gadgets/motd-variations.php
--- a/gadgets/motd-variations.php
+++ b/gadgets/motd-variations.php
@@ -7,7 +7,7 @@
<!-- Content -->
<?php
- $fortune = rtrim(`/usr/games/fortune`);
+ $fortune = rtrim(`/usr/bin/fortune`);
echo " <h3>English text</h3>\n";
echo " <p>$fortune</p>\n\n";
diff --git a/includes/core.php b/includes/core.php
--- a/includes/core.php
+++ b/includes/core.php
@@ -261,7 +261,7 @@
* @return string the server URL
*/
function get_server_url () {
- if (isset($_SERVER['HTTP_HOST'])) {
+ if (isset($_SERVER['HTTP_HOST']) && str_contains($_SERVER['HTTP_HOST'], ":")) {
list($name, $port) = explode(':', $_SERVER['HTTP_HOST'], 2);
} else {
$port = $_SERVER['SERVER_PORT'];
@@ -336,7 +336,7 @@
*/
function get_url_for () {
global $Config;
- $url = get_server_url() . '/' . $Config[BaseURL];
+ $url = get_server_url() . '/' . $Config['BaseURL'];
if (func_num_args()) {
$url .= implode('/', func_get_args());
}
diff --git a/includes/document.php b/includes/document.php
--- a/includes/document.php
+++ b/includes/document.php
@@ -284,7 +284,7 @@
}
//Footer
- if (!$nofooter && $footer = $this->get_footer()) {
+ if (!$this->nofooter && $footer = $this->get_footer()) {
include($footer);
}
}
diff --git a/lists/RegexpFactory.php b/lists/RegexpFactory.php
--- a/lists/RegexpFactory.php
+++ b/lists/RegexpFactory.php
@@ -59,7 +59,7 @@
public function isValid () {
$this->lastError = '';
set_error_handler('self::handleErrors');
- $result = preg_match($this->expression, null);
+ $result = preg_match($this->expression, "");
restore_error_handler();
if ($this->lastError === '' && $result === false) {
$this->lastError = self::getPCREError();
diff --git a/lists/operations.php b/lists/operations.php
--- a/lists/operations.php
+++ b/lists/operations.php
@@ -17,7 +17,7 @@
<div class="row">
<div class="large-3 columns">
<h6 class="panel" style="text-align: center;">List A</h6>
- <textarea name="lists[0]" rows=20><?= $_REQUEST['lists'][0] ?></textarea>
+ <textarea name="lists[0]" rows=20><?= $_REQUEST['lists'][0] ?? "" ?></textarea>
</div>
<div class="large-1 columns">
@@ -31,7 +31,7 @@
<div class="large-3 columns">
<h6 class="panel" style="text-align: center;">List B</h6>
- <textarea name="lists[1]" rows=20><?= $_REQUEST['lists'][1] ?></textarea>
+ <textarea name="lists[1]" rows=20><?= $_REQUEST['lists'][1] ?? "" ?></textarea>
</div>
<div class="large-3 columns">
diff --git a/lists/replace.php b/lists/replace.php
--- a/lists/replace.php
+++ b/lists/replace.php
@@ -70,7 +70,7 @@
<input
name="expression" id="expression" type="text"
placeholder="The Nginx or Apache mod_rewrite-like regular expression"
- value="<?= $_REQUEST['expression'] ?>"
+ value="<?= $_REQUEST['expression'] ?? "" ?>"
/>
<?php if (isset($regexp) && $regexp->lastError) echo '<small class="error" style="font-weight: 400;">', $regexp->lastError, '</small>'; ?>
</div>
@@ -78,7 +78,7 @@
<input
name="replacement" id="replacement" type="text"
placeholder="The list format. Use $1, $2, … to use the regexp groups."
- value="<?= $_REQUEST['replacement'] ?>"
+ value="<?= $_REQUEST['replacement'] ?? "" ?>"
/>
</div>
<div class="one mobile-one columns">
@@ -90,7 +90,7 @@
<span class="prefix">Join</span>
</div>
<div class="ten mobile-six columns">
- <input name="joinglue" id="joinglue" type="text" placeholder="Glue text to join the list into a string. Leave blank to concat without seperator. Don't forget to check the checkbox to enable." value="<?= $_REQUEST['joinglue'] ?>" onchange="updateUI();" />
+ <input name="joinglue" id="joinglue" type="text" placeholder="Glue text to join the list into a string. Leave blank to concat without seperator. Don't forget to check the checkbox to enable." value="<?= $_REQUEST['joinglue'] ?? "" ?>" onchange="updateUI();" />
</div>
<div class="one mobile-one columns" style="text-align: center;">
<span id="join-checkbox"><input type="checkbox" id="join" name="join" <?= $enable_join ? 'checked ' : '' ?>/><br /><label for="join">Enable</label></span>
@@ -101,7 +101,7 @@
<span class="prefix">Split</span>
</div>
<div class="ten mobile-six columns">
- <input name="splitseparator" id="splitseparator" type="text" placeholder="Separator text to split the list furthermore." value="<?= $_REQUEST['splitseparator'] ?>" onchange="updateUI();" />
+ <input name="splitseparator" id="splitseparator" type="text" placeholder="Separator text to split the list furthermore." value="<?= $_REQUEST['splitseparator'] ?? "" ?>" onchange="updateUI();" />
</div>
<div class="one mobile-one columns" style="text-align: center;">
<span id="split-checkbox"><input type="checkbox" id="split" name="split" <?= $enable_split ? 'checked ' : '' ?>/><br /><label for="split">Enable</label></span>
@@ -109,7 +109,7 @@
</div>
<div class="row collapse">
<div class="six columns">
- <textarea name="lists[0]" rows="16" style="width: 99%;" placeholder="The list to format"><?= $_REQUEST['lists'][0] ?></textarea>
+ <textarea name="lists[0]" rows="16" style="width: 99%;" placeholder="The list to format"><?= $_REQUEST['lists'][0] ?? "" ?></textarea>
</div>
<div class="six columns">
<textarea name="lists[1]" rows="16" style="width: 99%;" placeholder="The formatted list will appear here."><?= $result ?></textarea>

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 17:26 (16 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2311861
Default Alt Text
D2483.diff (8 KB)

Event Timeline