CMUBigLab / webanywhere

Accessible Technology Anywhere
http://webanywhere.cs.washington.edu/beta/
Other
17 stars 7 forks source link

Proper handling of data: links #58

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Links that have data directly embedded in them are not handled correctly by 
wawp.php. For instance, image data can be streamed inline by using the data: 
prefix for link. Fix provided below.

What steps will reproduce the problem?
1. Navigate to http://www.google.com/news
2. Notice that the square thumbnail images for the news stories are broken.

What is the expected output? What do you see instead?
Images that are linked with a data: prefix (instead of a http: prefix) should 
be rendered correctly. Instead, a broken image icon is displayed.

What version of the product are you using? On what operating system?
WebAnywhere Beta and current version from SVN.

Please provide any additional information below.
This can be fixed by updating the complete_url() function in wawp. Add an extra 
switch/case statement specifically for data prefixes. After "case 'm'" add:

      case 'd':
        // Handle data links; used for small images
        if(substr($url, 0, 5) == 'data:') {
          $proxify = false;
          break;
        }

Original issue reported on code.google.com by smur...@gmail.com on 13 Apr 2011 at 9:45