December 2009

If you do any sort of technical writing on WordPress, you have likely run into the wonderful little quirk of it turning your lovingly formatted double dashes '--' into singe em dashes. Rather annoying.

To add insult to injury, the silly thing shows them as double dashes in the editor, but then renders them as em dashes when viewing the post, making it next to impossible to know what is going on.

I thought I had it fixed at one time, but apparently the behavior snuck back in. I finally got tired of writing "those are two dashes not one" all over the place and went in search of a better answer.

Lo and behold I found one. Peter Cooper had the same problem and figured out how to take care of it. You can see his post here. His is for WordPress 2.5, but it also works for 2.8.x. I have combined his directions along with some info from the comments on his post here just in case I need it again and can't find it :)

Update: After I posted this, one of my friends on twitter, Chris John Riley, offered up another option. Add an HTML comment with just a space between the dashes. You will have to do this in the HTML view instead of Visual view of the editor. It will look like this:

-<!-- -->-

As I said to him, definitely less intrusive, although, with the method below, I just double dash away and don't worry about it :)

Thanks Chris!

WordPress has a built-in function called wp_texturize(). The purpose of this function is to make your beautiful prose lovely to look at too. :) Unfortunately, for those of use who do technical writing, it also completely mucks up some of our stuff.

To stop this from happening you need to edit the functions.php file in your current theme. This file is in your wp-content/themes/<your theme> directory.

All you have to do is add the following three lines to the end of the functions.php file.

<?php remove_filter('the_content', 'wptexturize'); ?>
<?php remove_filter('comment_text', 'wptexturize'); ?>
<?php remove_filter('the_rss_content', 'wptexturize'); ?>

These lines tell WordPress to quit mucking with punctuation in the main content, comments and rss feed. If you want to allow it to do so in any of the three, just omit the appropriate line.

Here is my functions.php file for reference:

<?php
  // Current version of K2
  define('K2_CURRENT', 'hidden cause you don't need to know');

  // Is this MU or no?
  define('K2_MU', (isset($wpmu_version) or (strpos($wp_version, 'wordpress-mu') !== false)));

  // Are we using K2 Styles?
  define('K2_CHILD_THEME', get_stylesheet() != get_template());

  // WordPress compatibility
  @define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
  @define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content' )

  /* Blast you red baron! Initialise the k2 system */
  require_once(TEMPLATEPATH . '/app/classes/k2.php');
  K2::init();
?>
<?php remove_filter('the_content', 'wptexturize'); ?>
<?php remove_filter('comment_text', 'wptexturize'); ?>
<?php remove_filter('the_rss_content', 'wptexturize'); ?>

One final note, this also affects all other punctuation changes, so you won't get smart quotes, etc.

-Kevin

{ 0 comments }

My Backtrack 4 – USB/Persistent Changes/Nessus How-To has been updated again. Changes below

  1. Updated Nessus install procedures for version 4.2.0.
  2. Moved the 'apt-get upgrade' section to before the Truecrypt volume creation section. We now have enough updates that the initial update runs out of disk space before completing if the Truecrypt volume was created first.

The updated version is here.

The pdf has also been updated and can be found here.

I have, however, also kept the previous version available and it can be found here.

As usual, let me know if you find any issues or problems.

-Kevin

{ 2 comments }

Good afternoon everybody! I hope your day is going well.

Here are today's Interesting Information Security Bits from around the web.

  1. Google introduced a new DNS service today.
    Google Code Blog: Introducing Google Public DNS: A new DNS resolver from Google
    Tags: ( google dns )
  2. This is pretty neat. Metasploit now has a built in vulnerability scanner.
    Metasploit Gets New Vulnerabilty Scanning Features - DarkReading
    Tags: ( metasploit vulnerability-scanning )
  3. Very cool. Sourcefire has rolled out a couple of VMWare-based virtual IDS appliances.
    Product Watch: Snort Maker Rolls Out IPSes For Virtual Environments - DarkReading
    Tags: ( snort sourcefire ids virtualization )

That's it for today. Have fun!

Subscribe to my RSS Feed if you enjoy these daily Interesting Bits posts.

Kevin

{ 0 comments }

Good afternoon everybody! It has been a crazy day and it isn't done yet by a long shot. Therefore, just a quick post with a few links. Sorry for the lack of my pithy/inane comments. :)

Here are today's Interesting Information Security Bits from around the web.

  1. Better Than Nothing Security: Part I - Secure Computing: Sec-C
    Tags: ( general )
  2. Schneier on Security: The Security Implications of Windows Volume Shadow Copy
    Tags: ( data-wiping )
  3. William Vambenepe -- Cloud + proprietary software =
    Tags: ( cloud )

That's it for today. Have fun!

Subscribe to my RSS Feed if you enjoy these daily Interesting Bits posts.

Kevin

{ 0 comments }

Good afternoon everybody! I hope your day is going well.

Here are today's Interesting Information Security Bits from around the web.

  1. This is a good article to send to all your friends who have children that are involved in social networking sites. Not a bad idea to read it and use its advice yourself either.
    IT Security Expert: Child Facebook Safety
    Tags: ( facebook safety )
  2. This is pretty cool. Bit.ly, the url shortener, will start checking urls for malicious sites.
    Sophos and bit.ly - making short links safer | Graham Cluley's blog
    Tags: ( malware url-shorteners )
  3. I really like the model that the Guerrilla CISO has come up with. Really puts some things in perspective.
    More on the Rybolov Information Security Management Model | The Guerilla CISO
    Tags: ( general )
  4. Rich is looking for comments on a "...a simple framework to help evaluate initial cloud risks and inform security decisions." that will be included in the next Security Guidance document from the Cloud Security Alliance. He is quick to mention that this is not a full risk assessment framework. Take a look and offer your thoughts.
    Securosis Blog | Cloud Risk Thoughts: Deciding What, When, and How to Move to the Cloud
    Tags: ( cloud )
  5. An interesting post with some interesting comments about the Radiant POS issue.
    Securosis Blog | Quick Thoughts on the Point of Sale Security Fail Lawsuit
    Tags: ( pci )

That's it for today. Have fun!

Subscribe to my RSS Feed if you enjoy these daily Interesting Bits posts.

Kevin

{ 0 comments }