Home    Submit Feeds   Editor Login Contact us
RSS 6
iPage Web Hosting -- Go Green for only $3.50/mo.
  RSS 6       Add us to favorites
   Make us your home page
   RSS Feed
Show this Feed on Your Site
Free Words Equal Money Newsletter! Register now!
Email:
Name:

We respect your privacy and will not share your email or send you spam.

Categories
Acne  (3)
Advertising  (14)
Advice  (7)
Apple  (2)
Art  (7)
Articles  (7)
Arts  (2)
Arts Crafts  (1)
Baby  (5)
Beauty  (2)
Blogging  (15)
Blogs  (12)
Business  (25)
Cameras  (2)
Careers  (1)
Cars  (5)
Cats  (1)
Celebrities  (9)
Celebrity  (5)
Children  (1)
Christianity  (1)
Clothing  (2)
Computers  (7)
Computing  (3)
Cosmetics  (1)
Credit  (3)
Culture  (3)
Current Affairs  (6)
Dating  (4)
Decorating  (2)
Design  (9)
Downloads  (1)
Education  (5)
Electronics  (2)
Entertainment  (18)
Environmental  (3)
Etiquette  (1)
Events  (1)
Family  (2)
Fashion  (7)
Financial  (26)
Fitness  (2)
Food  (2)
Free  (1)
Furniture  (10)
Games  (4)
Gardening  (2)
Gifts  (2)
Golf  (1)
Google  (5)
Gossip  (16)
Graphics  (6)
Hair  (1)
Health  (18)
Healthy Living  (2)
Helpful Info  (5)
Holidays  (7)
Hollywood  (2)
How To  (2)
Humor  (3)
HVAC  (1)
Insurance  (5)
Internet  (3)
Internet Marketing  (23)
Investing  (4)
Jewelry  (1)
Legal  (2)
Marketing  (11)
Media  (2)
Medicine  (1)
Memory  (1)
Men  (1)
Mens Health  (1)
Misc  (4)
Money  (2)
Movies  (9)
Multimedia  (2)
Music  (14)
News  (15)
Online  (2)
Online Advertising  (2)
Outdoors  (1)
Parenting  (1)
People  (15)
Personal  (3)
Pets  (4)
Philosophy  (2)
Photography  (2)
Photos  (4)
Pictures  (1)
Podcasting  (1)
Poker  (1)
Politics  (4)
Popular  (8)
Products  (1)
Programming  (6)
Promotion  (5)
Publications  (1)
Real Estate  (7)
Recreation  (3)
Reference  (2)
Relationships  (1)
Religion  (1)
Safety  (4)
Saving Money  (1)
Science  (2)
Search Engines  (3)
SEO  (8)
Shoes  (3)
Shopping  (4)
Society  (13)
Software  (3)
Sports  (7)
Squidoo  (1)
Style  (3)
Taxation  (2)
Tech  (9)
Technology  (7)
Television  (18)
Transportation  (1)
Travel  (2)
TV  (16)
Video  (1)
Videos  (2)
Web  (8)
Web Traffic  (3)
Webmaster  (12)
Weight Loss  (2)
Wellness  (2)
Women  (2)
Womens Health  (1)
Wordpress  (19)
Work  (1)
Writing  (2)

web
Feeds in this Category


Joel Comm
iFarted and Came Out Smelling Like a Rose at Ignite Fort Collins
iFarted and Came Out Smelling Like a Rose at Ignite Fort Collins

Years from now, people will still be asking me this question

:: Read More
(Published: Thu, 11 Mar 2010 00:05:32 -0700)

Inside Facebook
Facebook Credits Now the First Payment Option in FarmVille, Facebook’s Biggest App
The number of big social applications that use Facebook’s virtual currency, Credits, continues to rise. The latest is Zynga’s smash hit farming game, FarmVille, the largest application on Facebook with nearly 84 million users a month. The integration is pretty straightforward, as you can see from the screenshot below. Credits is shown as the first of
:: Read More
(Published: Wed, 10 Mar 2010 18:10:46 +0000)

WP Buddy Net
Magellan Maestro 4700 4.7-Inch Widescreen Bluetooth Portable GPS Navigator
Magellan Maestro 4700 4.7-Inch Widescreen Bluetooth Portable GPS Navigator The premium Magellan Maestro 4700 GPS device boasts the acclaimed and exclusive OneTouch favorites menu and an ultra-slim 4.7-inch widecolor touch screen. This post was submitted by momotaro.
:: Read More
(Published: Thu, 16 Jul 2009 13:34:51 +0000)

John Battelles Searchblog
Thursday Signal - Repeat After Me: Apps Are (Currently) Myopic (Or...We've Seen This Movie Before...)
I'm not claiming to be deeply informed about the app marketplace, which Google stirred up today (and, to my mind, the market could use a few more spoons). But I do use apps. At least, I use enough of them to feel like a nearly typical member of the
:: Read More
(Published: Wed, 10 Mar 2010 20:36:19 -0800)

Royal Pingdom
Innovation by acquisition
Innovation by moneyWhat do Android, Visio, Flash, Hotmail, Google Analytics and Powerpoint all have in common? Can you guess? The answer is: None of them were created by the companies who now own them. They were acquisitions. These products have continued to develop at their new homes, but the seed of innovation that sparked an actual, new product came from the outside. The key word here is innovation.
:: Read More
(Published: Wed, 10 Mar 2010 18:05:27 +0000)

Are You Insane
On June 4th, 1989

Nothing Happened

The quicker China acknowledges the situation, the better. Alas, it won’t.

:: Read More
(Published: Tue, 02 Jun 2009 21:26:54 +0000)

Dougal Campbell geek ramblings
Bug Chasing

Okay, so in my post about Code Spelunking I mentioned about how working on a project can lead you to explore the code because you need to become more familiar with how the code works. But it can also lead you to explore the code to figure out why code doesn’t work. In this particular case, I spent many hours puzzling over why something didn’t work correctly, chasing down the root cause, and eventually finding a bug in the WordPress core. I documented the bug in Ticket #12394, provided a patch, and it was committed to core in Changeset [13561], which will be part of WordPress 3.0.

And how did I find this little buglet? As usual, it’s because I was doing something a little off the beaten track. I was working on some code which imports XML data into WordPress, on a scheduled basis (hourly, daily, weekly, etc). During testing, sometimes the images in the imported content would come through fine, and other times, they would be missing the src attribute, without which, there really isn’t an image, is there? So you’d view the post and there would be this big 300-pixel square hole with just the alt text where the image should have been.

At first, I didn’t know why it worked only some of the time. Then I saw the pattern that when I ran the code “manually” via a “Run now” button in my options screen, the images worked. But when the code ran via WP-Cron, they didn’t. At first, I thought it was a timing issue, and that maybe when the cron action hooks fired, maybe there was some piece of WordPress functionality that wasn’t loaded yet. But shunting my execution hook to run at a later point didn’t fix anything.

Next, I decided that one key difference when running manually versus running from cron was me — I was logged in as an admin. And, in fact, after some debugging, I determined that there was no user context at all when running from cron. When I modified the code to run as myself, the image tags came through cleanly. Well, I didn’t want to hard-code the program to always run as me, so I added a user selector to the options so that the owner of the posts could be set.

But then when I started testing again, with users of various roles, the problem cropped up again. In particular, it worked great for a user with the Editor role, but not for the Author role. Digging a little deeper into the differences between the two roles, the thing that jumped out at me is that Editors (and Admins) have the “unfiltered_html” capability.

You see, normally, when you write a post, it is sent through a series of filters which take your free-form writing, and turn it into cleaner HTML. One of these filters is called ‘kses‘ (which stands for ‘kses strips evil scripts’). This filter is especially important on multi-author blogs where you might not be able to give 100% trust to the other authors. Otherwise, one of them would be able to (for instance) put javascript in a post which would steal the cookie information from another user who reads the post. So it is the job of kses to ensure that only “safe” HTML is kept. This would also keep you from embedding things like YouTube videos, Java applets, and other fun useful things. So users with the unfiltered_html capability set in their profiles are able to post without this filtering.

This certainly seemed like a likely culprit, except for one thing: even when post content is filtered through kses, the HTML img tag is not filtered out. And neither is the src attribute on an image. That is specifically supposed to be allowed. An image is a perfectly normal thing to have in a post. So why, oh why, was my src attribute being stripped?

I started looking very closely at the kses library. It’s a rather hairy bit of code, full of complex regular expressions and state-machine logic. But when reverse-engineering how the attribute-cleaning bits work, I noticed something in one of the regular expressions: it was hardcoded to expect a space between the end of an attribute and the closing of a tag. In other words, it expected an image tag to look something like this:

<img width='400' height='300' src='people.jpg' />

But, since my data was coming from an XML source, there was no extraneous space. My image tags looked like this:

<img width='400' height='300' src='people.jpg'/>

Notice the subtle difference? There is no space between the final single-quote around 'people.jpg' and the /> which closes the tag. And because of the way the match was being done, kses was throwing away any attribute that abutted the tag-close in that fashion.

The next question was: was this (technically) a bug, or was kses just being strict about some rules of formatting? A quick search turned up the Empty Elements section of the XHTML spec, which covers the syntax for empty tags like img, br, and hr. The examples given there do not include a space before the end of the elements. Furthermore, this section points to the HTML Compatibility Guidelines, which show that adding a space is for compatibility with older HTML browsers. So, since the XHTML spec does not require the space, and WordPress is supposed to render XHTML code, the behavior in kses was definitely a bug, and not just bad manners. I quickly worked up a patch, submitted it on Trac, and brought it to the attention of the core team.

Fortunately, the WordPress system of filters allows you to alter just about anything on the fly, so I was able to “trick” the system into thinking that the posting user selected in my plugin had the unfiltered_html capability, even when they really didn’t. This allowed me to work around the bug while my plugin is running.

This bug was pretty minor in the grand scheme of things. Probably not many people had ever run into it. But after hours of puzzling over those broken image tags, it felt darned good to find it, and — more importantly — squash it. And after the release of WordPress 3.0, nobody will have to scratch their heads over it again. Yay me!

Related posts:

  1. WordPress Code Spelunking
  2. WordPress Webhooks Plugin
  3. Easy Gravatars 1.2

:: Read More
(Published: Sat, 06 Mar 2010 14:33:15 -0800)

Thefacebook
Facebook Facts
Facebook was originally named TheFaceBook and it was developed by Harvard student Mark Zuckerberg. The first use of the FaceBook was on the Harvard campus and it was limited only to Harvard students. Soon the FaceBook spread like wild fire around the other major U.S. Universities. Mark Zuckerberg dr
:: Read More
(Published: Sun, 24 May 2009 09:11:00 CDT)


Sign Up       Sign In

:- Feeds Search

Exact Phrase Only
Search Our Feeds Database!

:- Recent Feeds
Outdoor furniture
National Agents Alliance Blog
Personal Growth With James Blackburn
Easter Bunny Baskets has Become an Easter Tradition
Security Safes from Gardall
Club Duvet Bedding
Questions about debit card fraud
DSNTD Information
Finding the right 1gb sd card
Aubenades tips and advice
Ten 34 Tips
Finding Chevy Rims
High Society Reality TV
Found Lab
Mike Liebner Internet Marketing
Ideas on Creating your own Easter Basket
The Braun 8985
Lip Palette Tips
Life Insurance Blog
Geek Zone
Frantic industries web 2.0, social networking IT technology trends
RSS Blog
Annie on the Web
Baby Boomer Quotes on Scribd
Personal Health Insurance Blog
Download Free Smileys
Leeds United Shirts
Article Spinning - Magic Article Rewriter
Pharmaceutical lobbyists
Health Care Reform
I am Cute
http://www.blogs1.com/2010/03/03/42554/
Compare digital cameras
Buy your chic interior furniture online
Honeywell Fire Safes
Complete Listing

:- Right Now in Tags
furniture game consoles nintendo ds mobile phones software sexy selling home mcphee save house xbox 360 decor reviews relief entertainment homes for sale ottoman realty John Mayer Head Lice sale house R. Kelly ps2 sell house head of household

RSS 6

© Copyright 2010 RSS 6


More at the RSS 6 Home Page