- Introduced placeholder [scheme] also for the website's "Redirect" tab.
| | |
| | | 'redirect_path' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'validators' => array ( 0 => array ( 'type' => 'REGEX', |
| | | 'regex' => '@^(([.]{0})|(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.\,\-\+\?\~]*(\?\S+)?)?)?)|(/[\w/_\.\-]{1,255}/))$@', |
| | | 'regex' => '@^(([.]{0})|(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.\,\-\+\?\~]*(\?\S+)?)?)?)|(\[scheme\]://([-\w\.]+)+(:\d+)?(/([\w/_\.\-\,\+\?\~]*(\?\S+)?)?)?)|(/[\w/_\.\-]{1,255}/))$@', |
| | | 'errmsg'=> 'redirect_error_regex'), |
| | | ), |
| | | 'formtype' => 'TEXT', |
| | |
| | | $rewrite_rules = array(); |
| | | if($data['new']['redirect_type'] != '') { |
| | | if(substr($data['new']['redirect_path'],-1) != '/') $data['new']['redirect_path'] .= '/'; |
| | | $rewrite_target = $data['new']['redirect_path']; |
| | | $rewrite_target_ssl = $data['new']['redirect_path']; |
| | | if(substr($data['new']['redirect_path'],0,8) == '[scheme]'){ |
| | | $rewrite_target = 'http'.substr($data['new']['redirect_path'],8); |
| | | $rewrite_target_ssl = 'https'.substr($data['new']['redirect_path'],8); |
| | | } else { |
| | | $rewrite_target = $data['new']['redirect_path']; |
| | | $rewrite_target_ssl = $data['new']['redirect_path']; |
| | | } |
| | | /* Disabled path extension |
| | | if($data['new']['redirect_type'] == 'no' && substr($data['new']['redirect_path'],0,4) != 'http') { |
| | | $data['new']['redirect_path'] = $data['new']['document_root'].'/web'.realpath($data['new']['redirect_path']).'/'; |
| | |
| | | $rewrite_rules = array(); |
| | | if($data['new']['redirect_type'] != '') { |
| | | if(substr($data['new']['redirect_path'],-1) != '/') $data['new']['redirect_path'] .= '/'; |
| | | if(substr($data['new']['redirect_path'],0,8) == '[scheme]') $data['new']['redirect_path'] = '$scheme'.substr($data['new']['redirect_path'],8); |
| | | /* Disabled path extension |
| | | if($data['new']['redirect_type'] == 'no' && substr($data['new']['redirect_path'],0,4) != 'http') { |
| | | $data['new']['redirect_path'] = $data['new']['document_root'].'/web'.realpath($data['new']['redirect_path']).'/'; |