Conditions | 3 |
Paths | 4 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
35 | protected function getReferer( Command $command ) |
||
36 | { |
||
37 | $referer = trim( get_post_meta( $command->post_id, 'redirect_to', true )); |
||
38 | if( empty( $referer )) { |
||
39 | $referer = $command->referer; |
||
40 | } |
||
41 | if( empty( $referer )) { |
||
42 | glsr_log()->warning( 'The form referer ($_SERVER[REQUEST_URI]) was empty.' )->info( $command ); |
||
43 | $referer = home_url(); |
||
44 | } |
||
45 | return $referer; |
||
46 | } |
||
48 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.