| @@ 96-105 (lines=10) @@ | ||
| 93 | $accept = $param_value; |
|
| 94 | } |
|
| 95 | break; |
|
| 96 | case "header": |
|
| 97 | if(!empty($param_value)) { |
|
| 98 | if(!preg_match('![\w\d-]+: .+!',$param_value)) { |
|
| 99 | $smarty->_trigger_fatal_error("[plugin] invalid header format '".$param_value."'"); |
|
| 100 | return; |
|
| 101 | } else { |
|
| 102 | $extra_headers[] = $param_value; |
|
| 103 | } |
|
| 104 | } |
|
| 105 | break; |
|
| 106 | case "proxy_host": |
|
| 107 | if(!empty($param_value)) { |
|
| 108 | $proxy_host = $param_value; |
|
| @@ 111-118 (lines=8) @@ | ||
| 108 | $proxy_host = $param_value; |
|
| 109 | } |
|
| 110 | break; |
|
| 111 | case "proxy_port": |
|
| 112 | if(!preg_match('!\D!', $param_value)) { |
|
| 113 | $proxy_port = (int) $param_value; |
|
| 114 | } else { |
|
| 115 | $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'"); |
|
| 116 | return; |
|
| 117 | } |
|
| 118 | break; |
|
| 119 | case "agent": |
|
| 120 | if(!empty($param_value)) { |
|
| 121 | $agent = $param_value; |
|
| @@ 129-136 (lines=8) @@ | ||
| 126 | $referer = $param_value; |
|
| 127 | } |
|
| 128 | break; |
|
| 129 | case "timeout": |
|
| 130 | if(!preg_match('!\D!', $param_value)) { |
|
| 131 | $timeout = (int) $param_value; |
|
| 132 | } else { |
|
| 133 | $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'"); |
|
| 134 | return; |
|
| 135 | } |
|
| 136 | break; |
|
| 137 | default: |
|
| 138 | $smarty->_trigger_fatal_error("[plugin] unrecognized attribute '".$param_key."'"); |
|
| 139 | return; |
|