Project

General

Profile

Actions

Bug(バグ) #3212

open

mobile_frontend アプリケーションの default/urlProxy の処理とこのページに飛ぶ前の _op_auto_links_outer_urls() ヘルパーの処理でHTMLエスケープとURLエンコードの順番が逆になっている

Added by Shinichi Urabe over 12 years ago. Updated almost 5 years ago.

Status:
New(新規)
Priority:
Normal(通常)
Assignee:
-
Target version:
Start date:
2012-09-27
Due date:
% Done:

0%

Estimated time:
3.6 で発生するか:
Unknown (未調査)
3.8 で発生するか:
Unknown (未調査)

Description

現象

  1. プロフィール本文や日記本文に外部のURL ( http://example.com/?hoge=fuga&test=tetete ) のようなURLを投稿する
  2. 携帯端末で日記本文やプロフィール本文を開き、URLをクリックすると中継用のページが表示される
  3. 以下のポイントが不自然である
    1. 中継用のページに飛んだ時点でURLを見ると ( /proxy?url=http%3A%2F%2Fexample.com%2F%3Fhoge%3Dfuga%26amp%3Btest%3Dtetete ) のようになっている
    2. input フィールドの URL が ( http://example.com/?hoge=fuga&test=tetete ) となっている
    3. mailto のスキームを開くと ( http://example.com/?hoge=fuga&test=tetete ) となっている
    4. Googleの変換用のURLも ( http://www.google.co.jp/gwt/x?u=http%3A%2F%2Fexample.com%2F%3Fhoge%3Dfuga%26amp%3Bamp%3Btest%3Dtetete ) となっている

原因

  • A: _op_auto_links_outer_urls() ヘルパーにパラメータが渡った時点でHTMLエスケープされた文字列が渡ってきている、HTMLエスケープされた文字列を urlencode() している 「処理の順番が逆」
  • B: default/urlProxy のテンプレートで HTMLエスケープされた文字列を urlencode() している「処理の順番が逆」

修正案

  • urlencode() した文字列を HTMLエスケープするように順番を変える
  • HTMLエスケープされた文字列は一度戻したうえで、urlencode() し、その文字列を再度 HTMLエスケープするように処理を変える

Files

issue-3212.patch (3.87 KB) issue-3212.patch Shinichi Urabe, 2012-09-27 02:12
Actions #1

Updated by Shinichi Urabe over 12 years ago

修正案のパッチを添付します

(注) 添付の修正案は _op_auto_links_outer_urls() にHTMLエスケープをされていない文字列が渡された場合の挙動は考慮できていないため修正は不十分である

Actions #2

Updated by Shinichi Urabe over 12 years ago

  • Description updated (diff)
Actions #3

Updated by Shinichi Urabe over 12 years ago

  • Description updated (diff)
Actions #4

Updated by kaoru n almost 8 years ago

  • Target version changed from OpenPNE 3.9.0-old to OpenPNE 3.9.0
Actions #5

Updated by isao sano over 7 years ago

再現を確認しました。

Actions #6

Updated by kaoru n almost 5 years ago

  • Target version changed from OpenPNE 3.9.0 to OpenPNE 3.10.x
Actions

Also available in: Atom PDF