mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-19 18:32:52 +09:00
#51 preg_match()를 substr_compare() 또는 strncmp()로 대체
This commit is contained in:
parent
681a9b2d07
commit
63e0fd6f3b
20 changed files with 68 additions and 61 deletions
|
|
@ -81,8 +81,12 @@ class moduleModel extends module
|
|||
*/
|
||||
function getDefaultMid()
|
||||
{
|
||||
$default_url = preg_replace('/\/$/','',Context::getDefaultUrl());
|
||||
$request_url = preg_replace('/\/$/','',Context::getRequestUri());
|
||||
$default_url = Context::getDefaultUrl();
|
||||
if(substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
|
||||
|
||||
$request_url = Context::getRequestUri();
|
||||
if(substr_compare($request_url, '/', -1) === 0) $request_url = substr($request_url, 0, -1);
|
||||
|
||||
$default_url_parse = parse_url($default_url);
|
||||
$request_url_parse = parse_url($request_url);
|
||||
$vid = Context::get('vid');
|
||||
|
|
@ -95,7 +99,9 @@ class moduleModel extends module
|
|||
{
|
||||
$url_info = parse_url($request_url);
|
||||
$hostname = $url_info['host'];
|
||||
$path = preg_replace('/\/$/','',$url_info['path']);
|
||||
$path = $url_info['path'];
|
||||
if(substr_compare($path, '/', -1) === 0) $path = substr($path, 0, -1);
|
||||
|
||||
$domain = sprintf('%s%s%s', $hostname, $url_info['port']&&$url_info['port']!=80?':'.$url_info['port']:'',$path);
|
||||
}
|
||||
// xe.com/blog
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue