Skip to content

Commit 90811f2

Browse files
bramleymichield
authored andcommitted
Output the command line signature in only one place in index.php, allowing all other calls to ClineSignature() to be removed (#456)
1 parent 7d35228 commit 90811f2

File tree

11 files changed

+2
-29
lines changed

11 files changed

+2
-29
lines changed

public_html/lists/admin/connect.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,14 +442,12 @@ function ClineSignature()
442442
function ClineError($msg)
443443
{
444444
ob_end_clean();
445-
echo ClineSignature();
446445
echo "\nError: $msg\n";
447446
exit;
448447
}
449448

450449
function clineUsage($line = '')
451450
{
452-
cl_output(clineSignature());
453451
cl_output( 'Usage: '.$_SERVER['SCRIPT_FILENAME']." -p page $line".PHP_EOL);
454452
}
455453

public_html/lists/admin/convertstats.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@
66
echo '<p class="information">'.$GLOBALS['I18N']->get('Hint: this page also works from commandline').'</p>';
77
$limit = 10000;
88
} else {
9-
@ob_end_clean();
10-
echo ClineSignature();
119
//# when on cl, doit immediately
1210
$_GET['doit'] = 'yes';
1311
//# on commandline handle more
1412
$limit = 50000;
15-
ob_start();
1613
}
1714

1815
function output($message)

public_html/lists/admin/cron.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919
return;
2020
}
21-
22-
cl_output(ClineSignature());
23-
2421
$cronJobs = array(
2522

2623
// at a later stage, these should be added

public_html/lists/admin/import.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
if (!$cline['l']) {
5959
echo ClineError('Specify lists to import users to');
6060
}
61-
echo clineSignature();
6261

6362
ob_start();
6463
$_FILES['import_file'] = array(

public_html/lists/admin/index.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ function mb_strtolower($string)
182182

183183
$GLOBALS['require_login'] = 1; ## this is no longer configurable and should never have been
184184
if ($GLOBALS['commandline']) {
185+
cl_output(ClineSignature());
185186
if (!isset($_SERVER['USER']) && count($GLOBALS['commandline_users'])) {
186187
clineError('USER environment variable is not defined, cannot do access check. Please make sure USER is defined.');
187188
exit;
@@ -206,7 +207,6 @@ function mb_strtolower($string)
206207
} elseif (isset($cline['p'])) {
207208
$_GET['page'] = $cline['p'];
208209
}
209-
cl_output( ClineSignature());
210210
cl_processtitle('core-'.$_GET['page']);
211211
} elseif ($cline['p'] && $IsCommandlinePlugin) {
212212
if (empty($GLOBALS['developer_email']) && isset($cline['p']) && !in_array($cline['p'],
@@ -216,7 +216,6 @@ function mb_strtolower($string)
216216
} elseif (isset($cline['p'])) {
217217
$_GET['page'] = $cline['p'];
218218
$_GET['pi'] = $cline['m'];
219-
cl_output( ClineSignature());
220219
cl_processtitle($_GET['pi'].'-'.$_GET['page']);
221220
}
222221
} else {

public_html/lists/admin/initlanguages.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99

1010
return;
1111
}
12-
ob_end_clean();
13-
echo ClineSignature();
14-
ob_start();
15-
1612
$locale_root = dirname(__FILE__).'/locale/';
1713

1814
$force = isset($cline['f']);

public_html/lists/admin/processbounces.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030
//# we're in a normal session, so the csrf token should work
3131
verifyCsrfGetToken();
3232
}
33-
} else {
34-
ob_end_clean();
35-
echo ClineSignature();
36-
ob_start();
3733
}
3834

3935
flush();

public_html/lists/admin/processqueue.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
return;
2020
}
2121
} else {
22-
@ob_end_clean();
23-
echo ClineSignature();
24-
ob_start();
2522
include dirname(__FILE__).'/actions/processqueue.php';
2623

2724
return;

public_html/lists/admin/send.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@
124124
if ($done) {
125125
if ($GLOBALS['commandline']) {
126126
ob_end_clean();
127-
echo clineSignature();
128127
echo 'Message with subject '.$_POST['subject'].' was sent to '.$lists."\n";
129128
exit;
130129
}

public_html/lists/admin/updatetlds.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
@ob_end_flush();
55
echo '<p class="information">'.s('This page only works from commandline').'</p>';
66
return;
7-
} else {
8-
cl_output(ClineSignature());
97
}
108

119
if (isset($cline['f'])) {
@@ -14,4 +12,4 @@
1412
refreshTlds(false);
1513
}
1614
$tlds = explode('|', getConfig('internet_tlds'));
17-
cl_output(s('Now we have %d top level domains',count($tlds)));
15+
cl_output(s('Now we have %d top level domains',count($tlds)));

0 commit comments

Comments
 (0)