Skip to content

Commit 7e55fb3

Browse files
authored
Fix javascript "back button" links (#650)
Use history.back() method instead of currently non-functional back()
1 parent e7c1ab1 commit 7e55fb3

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/CommonErrors.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
9191
$errorTitle = 'Invalid Information';
9292
$internalErrorTitle = 'Bad Input';
9393
$errorMessage = 'Some of the information you provided doesn\'t follow the correct format and '
94-
. 'CATS can\'t interpret what it is. Please <a href="javascript:back()">go back</a> and '
94+
. 'CATS can\'t interpret what it is. Please <a href="javascript:history.back()">go back</a> and '
9595
. 'complete each field paying close attention to any instructions provided. '
9696
. '<p><b>' . $customMessage . '</b>';
9797
break;
@@ -124,7 +124,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
124124
. 'traffic or older web browsers. The latest version of the <a href="http://www.getfirefox.com"> '
125125
. 'Mozilla Firefox&copy;</a> browser '
126126
. 'is recommended.<br /><br />The problem may be resolved by using the '
127-
. '<a href="javascript:back()">back button</a> on your browser and trying again.';
127+
. '<a href="javascript:history.back()">back button</a> on your browser and trying again.';
128128
break;
129129
case COMMONERROR_BADINDEX:
130130
$errorTitle = 'Bad Server Information';
@@ -139,7 +139,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
139139
. 'may have been provided to you.'
140140
. '<br /><br />'
141141
. '<b>It\'s ok!</b> CATS can\'t complete whatever action you requested; but chances are, '
142-
. 'if you click the <a href="javascript:back()">back button</a> and <b>refresh</b> the page '
142+
. 'if you click the <a href="javascript:history.back()">back button</a> and <b>refresh</b> the page '
143143
. 'and try again it will work just fine.';
144144
break;
145145

@@ -148,7 +148,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
148148
$internalErrorTitle = 'Permission Denied';
149149
$errorMessage = 'You don\'t have access to the action you\'re attempting to perform. If you '
150150
. 'feel you should have access, contact your site administrator. '
151-
. 'You can click the <a href="javascript:back()">back</a> button on your browser to return '
151+
. 'You can click the <a href="javascript:history.back()">back button</a> on your browser to return '
152152
. 'to where you came from.';
153153
break;
154154

@@ -169,7 +169,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
169169
$internalErrorTitle = 'Required Fields Missing';
170170
$errorMessage = 'One or more of the input fields on the page you came from were required and '
171171
. 'were left with blank or incorrect values. The action you\'re trying to perform cannot '
172-
. 'be completed without those fields. Please use the <a href="javascript:back()">back button</a> '
172+
. 'be completed without those fields. Please use the <a href="javascript:history.back()">back button</a> '
173173
. 'on your browser to return to where you came from.'
174174
. '<br /><br />';
175175

@@ -189,7 +189,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
189189
$internalErrorTitle = 'Missing wild card string';
190190
$errorMessage = 'One or more of the input fields on the page you came from were required and '
191191
. 'were left with blank or incorrect values. The action you\'re trying to perform cannot '
192-
. 'be completed without those fields. Please use the <a href="javascript:back()">back button</a> '
192+
. 'be completed without those fields. Please use the <a href="javascript:history.back()">back button</a> '
193193
. 'on your browser to return to where you came from.'
194194
. '<br /><br />';
195195

@@ -207,7 +207,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
207207
case COMMONERROR_NOPASSWORDMATCH:
208208
$errorTitle = 'Passwords do not Match';
209209
$internalErrorTitle = 'Passwords do not match';
210-
$errorMessage = 'The passwords you entered do not match. Please use the <a href="javascript:back()">'
210+
$errorMessage = 'The passwords you entered do not match. Please use the <a href="javascript:history.back()">'
211211
. 'back button</a> on your browser to return from where you came and enter the correct password '
212212
. 'in all required fields.';
213213
break;
@@ -216,7 +216,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
216216
$errorTitle = 'File Does Not Exist';
217217
$internalErrorTitle = 'File Does Not Exist';
218218
$errorMessage = 'The file you are requesting for does not exist. Please use the '
219-
. '<a href="javascript:back()">back button</a> on your browser to return to where '
219+
. '<a href="javascript:history.back()">back button</a> on your browser to return to where '
220220
. 'you came from.<br /><br />';
221221

222222
if (!empty($customMessage))
@@ -229,7 +229,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
229229
$errorTitle = 'An Error Has Occurred';
230230
$internalErrorTitle = 'Undefined';
231231
$errorMessage = 'An error has occurred and the operation you were attempting to perform cannot be '
232-
. 'completed. Please use the <a href="javascript:back();">back</a> button on your web browser '
232+
. 'completed. Please use the <a href="javascript:history.back();">back button</a> on your web browser '
233233
. 'to return from where you came. The administrators have been notified, so you may wish to '
234234
. 'try again later.';
235235
break;

modules/import/ImportUI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ public function massImport($step = 1)
15561556
{
15571557
$this->_template->assign('errorMessage', 'You didn\'t upload any files or there was a '
15581558
. 'problem working with any files you uploaded. Please use the '
1559-
. '<a href="javascript:back()"><b>Back</b></a> button on your web browser '
1559+
. '<a href="javascript:history.back()"><b>Back button</b></a> on your web browser '
15601560
. 'and select one or more files to import.'
15611561
);
15621562

0 commit comments

Comments
 (0)