New here? Then you may want to subscribe to my rss feed. :)

Wordtube and protected wordpress posts

August 19th, 2007 | Posted in Development, PHP | 3 Comments

I rarely password protect posts. Never have anything I wouldn’t want prying eyes to see. Occasionally though, I do have to place content behind a password entry form.

Using Wordtube, I uploaded an .flv file and password protected the page. I noticed that the RSS feed had a link to the .flv file in its “enclosure” tag. This revealed the path to the video file I was intending to hide.

Digging through Wordpress RSS feed generating scripts, I saw that this had been taken into account and couldn’t work out how this particular one was getting through. Well, would you Adam and Eve it, Wordtube also has its own RSS feed generator.

By adding a check to the RSS generating code prevented it from revealing .flv, .mp3, .swf and .jpg files.

In wordtube.php, at line 233…ish:

  1. // Add single media file to RSS feed
  2. function add_wpTube_rss2_file()
  3. {
  4.         GLOBAL $wpdb, $post;
  5.  
  6.         // CHECK FOR PASSWORD PROTECTED POST
  7.         // RETURN IF POST IS PROTECTED
  8.         if ( !empty($post->post_password))
  9.                 return;
  10.  
  11.         $search = "/\[MEDIA=(\d+)\]/";   //search for ‘media’ entry
  12.         preg_match_all($search, $post->post_content, $matches);

Any problems then let me know.

3 Responses to “Wordtube and protected wordpress posts”

  • Gravatar
    Ganbaa Location: China //

    How to disable that i am have big problem like that too
    Help more details .pls???

    Also is there any way i protect the .flv video’s for been downloaded by Flashget or something. And allow wordtube load it.

    Best
    Ganbat.D

  • Gravatar
    Ganbaa Location: China //

    Hey

    i deleted that // Add single media file to RSS feed from line 233 to 240 (i guess) completely form the wordtube.php .Looks like perfect

    But is it gonna effect some other thing.

    Anyways after i deleted it . it isn’t showing my .flv url ,(WOW)
    Just asking :)

    Best
    Thanks

  • Gravatar
    ZYON Location: United States //

    Thanks for this incredibly detailed post. Information like this is what keeps me coming back.

    Thanks again,
    Martin

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>