Skip to content

Commit

Permalink
Modified to allow routes to start with "/index.php?" (not with "/inde…
Browse files Browse the repository at this point in the history
…x.php/")
  • Loading branch information
mystralkk committed Jan 23, 2016
1 parent 0407a81 commit 73ec58c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion language/english.php
Expand Up @@ -1355,7 +1355,7 @@
13 => 'Rule is a mandatory item.',
14 => 'Route is a mandatory item.',
15 => 'Placeholders (@) in a rule and those in a route must be the same.',
16 => 'Route must not start with "index.php".',
16 => 'Route must not start with "/index.php/".',
17 => 'Database error occurred.',
18 => '<strong>To enable URL routing, you have to enable URL rewrite.</strong>',
19 => '<ul><li>Placeholders (@) must be the same both in a rule and its route.</li><li>A placeholder starts with "@", followed by an alphabet, optionally followed by any length of alphabet or digit.</li><li>Placeholders are case-sensitive.</li></ul>',
Expand Down
2 changes: 1 addition & 1 deletion language/english_utf-8.php
Expand Up @@ -1355,7 +1355,7 @@
13 => 'Rule is a mandatory item.',
14 => 'Route is a mandatory item.',
15 => 'Placeholders (@) in a rule and those in a route must be the same.',
16 => 'Route must not start with "index.php".',
16 => 'Route must not start with "/index.php/".',
17 => 'Database error occurred.',
18 => '<strong>To enable URL routing, you have to enable URL rewrite.</strong>',
19 => '<ul><li>Placeholders (@) must be the same both in a rule and its route.</li><li>A placeholder starts with "@", followed by an alphabet, optionally followed by any length of alphabet or digit.</li><li>Placeholders are case-sensitive.</li></ul>',
Expand Down
2 changes: 1 addition & 1 deletion language/japanese_utf-8.php
Expand Up @@ -1354,7 +1354,7 @@
13 => 'ルールは必須項目です。',
14 => 'ルートは必須項目です。',
15 => 'ルールとルートで同じプレースホルダー(@)を定義しなければなりません。',
16 => 'ルートの先頭にindex.phpを含むことはできません。',
16 => 'ルートの先頭を "/index.php/" とすることはできません。',
17 => 'データベース操作でエラーが発生しました。',
18 => '<strong>URLルーティングを有効にするには、URLリライトを有効にしてください。</strong>',
19 => '<ul><li>プレースホルダー(@)はルールとルートで同じものを定義してください。</li><li>プレースホルダーは@で始まり、1文字目は英字、2文字目以降は英数字を使えます。</li><li>プレースホルダーは大文字・小文字を区別します。</li></ul>',
Expand Down
4 changes: 2 additions & 2 deletions public_html/admin/router.php
Expand Up @@ -343,9 +343,9 @@ function saveRoute($rid, $method, $rule, $route, $priority)
$route = '/' . $route;
}

// If a route starts with "/index.php", then make it an error to prevent the script
// If a route starts with "/index.php/", then make it an error to prevent the script
// from going an infinite loop
if (stripos($route, '/index.php') === 0) {
if (stripos($route, '/index.php/') === 0) {
$messageText = $LANG_ROUTER[16];
}

Expand Down
3 changes: 2 additions & 1 deletion public_html/docs/english/config.html
Expand Up @@ -2154,7 +2154,8 @@ <h2><a name="url-routing">URL Routing</a></h2>
and @month matches "1" in the rule. Then, all placeholders in the route will be replaced with
the matched values. And you will be redirected to "http://yourdomain/directory.php?topic=all&year=2016&month=1".</p>
<p>You don't have to include "/index.php" in a rule.</p>
<p>You must not start a route with "/index.php", since this will cause an infinite loop.</p>
<p>You must not start a route with "/index.php/", since this will cause an infinite loop. However, you can start
with a route with "/index.php?".</p>
<p>A placeholder starts with @ and an alphabetical letter or letters follow it.
Placeholders are case-sensitive.</p>
<p>URL Routing works in the reverse way as well. When you output a URL in your plugin or custom
Expand Down
2 changes: 1 addition & 1 deletion public_html/docs/japanese/config.html
Expand Up @@ -1852,7 +1852,7 @@ <h2><a name="url-routing">URLルーティング</a></h2>
プレースホルダーがマッチした値に置き換えられ、"http://yourdomain/directory.php?topic=all&year=2016&month=1"
にリダイレクトされます。</p>
<p>ルールの中に"/index.php"を含める必要はありません。</p>
<p>無限ループになるので、ルートを "/index.php" で始めないようにしてください</p>
<p>無限ループになるので、ルートの先頭は "/index.php/" にしないでください("/index.php?" は大丈夫です)</p>
<p>プレースホルダーは@で始まり、アルファベットが続きます。プレースホルダーは大文字・小文字を区別します。</p>
<p>URLルーティングは逆向きにも働きます。自作のプラグインやカスタム関数の中でURLを出力する時に、
COM_buildURL 関数を使い、URLルーティング(admin/router.php)で独自のルールとルートを設定する
Expand Down

0 comments on commit 73ec58c

Please sign in to comment.