function isPage($link) { if (strpos($link, site_prefix() . '/index') === false) { return false; } $parts = parse_url($link); $page = basename($parts['path']); if (empty($page)) { return 'index'; } $strlen = strlen($page); if ($strlen > 7 && better_strrpos($page, '-action') == $strlen - 7) { return false; } elseif ($strlen > 5 && better_strrpos($page, '-form') == $strlen - 5) { return false; } elseif ($strlen > 4 && better_strrpos($page, '-app') == $strlen - 4) { return false; } return $page; }
function isPage($link) { if (strpos($link, 'cms-filesystem-action') !== false) { return false; } if (!conf('Site', 'remove_index')) { if (strpos($link, site_prefix() . '/index') === false) { return false; } } else { if (strpos($link, site_prefix() . '/') === false) { return false; } } $parts = parse_url($link); $page = basename($parts['path']); if (!empty($parts['host']) && $parts['host'] != site_domain()) { return false; } if (empty($page)) { return 'index'; } $strlen = strlen($page); if ($strlen > 7 && better_strrpos($page, '-action') == $strlen - 7) { return false; } elseif ($strlen > 5 && better_strrpos($page, '-form') == $strlen - 5) { return false; } elseif ($strlen > 4 && better_strrpos($page, '-app') == $strlen - 4) { return false; } return $page; }