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  (9)
Arts  (2)
Arts Crafts  (1)
Baby  (5)
Beauty  (4)
Blogging  (15)
Blogs  (13)
Business  (26)
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  (3)
Design  (9)
Downloads  (1)
Education  (6)
Electronics  (3)
Entertainment  (18)
Environmental  (3)
Equipment  (1)
Etiquette  (1)
Events  (1)
Family  (4)
Fashion  (7)
Financial  (27)
Fitness  (2)
Food  (2)
Free  (1)
Furniture  (10)
Games  (4)
Gardening  (3)
Gifts  (4)
Golf  (1)
Google  (5)
Gossip  (16)
Graphics  (6)
Hair  (1)
Health  (20)
Healthy Living  (3)
Helpful Info  (6)
Holidays  (7)
Hollywood  (2)
How To  (2)
Humor  (3)
HVAC  (2)
Insurance  (5)
Internet  (3)
Internet Marketing  (24)
Investing  (4)
Jewelry  (1)
Legal  (2)
Marketing  (11)
Media  (2)
Medicine  (1)
Memory  (1)
Men  (1)
Mens Health  (1)
Misc  (4)
Money  (3)
Movies  (9)
Multimedia  (2)
Music  (14)
News  (16)
Online  (2)
Online Advertising  (2)
Outdoors  (1)
Parenting  (1)
People  (16)
Personal  (3)
Pets  (4)
Philosophy  (2)
Photography  (2)
Photos  (4)
Pictures  (1)
Podcasting  (1)
Poker  (1)
Politics  (4)
Popular  (8)
Products  (1)
Programming  (7)
Promotion  (5)
Publications  (1)
Real Estate  (7)
Recreation  (3)
Reference  (2)
Relationships  (1)
Religion  (1)
Safety  (5)
Saving Money  (1)
Science  (2)
Search Engines  (3)
SEO  (8)
Shoes  (3)
Shopping  (5)
Society  (13)
Software  (3)
Sports  (7)
Squidoo  (1)
Style  (3)
Taxation  (2)
Tech  (9)
Technology  (7)
Television  (18)
Transportation  (1)
Travel  (5)
TV  (16)
Video  (1)
Videos  (2)
Web  (8)
Web Traffic  (3)
Webmaster  (12)
Weight Loss  (3)
Wellness  (2)
Women  (2)
Womens Health  (1)
Wordpress  (19)
Work  (2)
Writing  (2)

web
Feeds in this Category


Inside Facebook
Facebook Employee Count Rising this Year, Up Past 1300 Already
Facebook already has more than 1000 employees, and it said it plans to increase that by at least 50% this year, according to previous reports. That number has been growing fast, from what we’ve gathered. It is now past 1300, according to sources, although Facebook is only confirming that it is above 1200. We heard
:: Read More
(Published: Sat, 20 Mar 2010 01:10:02 +0000)

Royal Pingdom
Facebook may have surpassed Google in the US, but what about other countries?
Facebook versus Google There was a significant amount of media attention earlier this week around a report from traffic monitoring company Hitwise that claimed Facebook now has more traffic than Google in the US. So let's have a look at how it's doing in the rest of the world.
:: Read More
(Published: Fri, 19 Mar 2010 18:09:14 +0000)

John Battelles Searchblog
Microsoft Got Hand(s)
From my Friday Signal over at FM's blog:
:: Read More
(Published: Fri, 19 Mar 2010 13:14:17 -0700)

Joel Comm
The Traffic Ultimatum Course
The Traffic Ultimatum Course

Wow, that is one great looking web site.

You must have spent a lot of time and energy creating that content.

And your product

:: Read More
(Published: Thu, 18 Mar 2010 14:36:45 -0700)

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)

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)

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)

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
Coupon online for everything you need! “Hot coupon
Plan a trip, find cheap airline tickets, hotel ...
Greatest Gold-Mine Of Easy "Soy Candles"
Gift ideas for home decor.
Family tips and reminders
Healthy life style
Suprice some one that has everything.
Personal Finance Treasure
FInance magic
Affiliate classroom
Other Helper
Cornerstone Educate
Article Drum
The Carlisle Post
INHJA knowledge articles
Email Name Search
Wrinkle Creams
Used Lawn Mower Parts
Tree Climbing Equipment
Best HDTV Antenna
Best Eye Wrinkle Creams
Bank Car Loans
Depression
Display Shelves and Accessories
Glass Showcases and Displays
AC Home Heating HVAC Blog
Health Fitness and Nutrition News and Articles
Profit php
Vacuum Cleaner Tips, Maintenance and Products
Canal and River Boating Holidays in the UK and Europe
Log Cabin Holidays and Holiday Park Breaks
Security and Locks for your home
Cheap Weight Loss
Outdoor furniture
National Agents Alliance Blog
Complete Listing

:- Right Now in Tags
toner sales DVR floor gift ideas home decor wheel rims Genital Warts rent jewelry News and Knowledge auto pelvic advertising Educational Neck Pain news Cellular Phones marketing Family Genital Warts Cure chevy rims

RSS 6

© Copyright 2010 RSS 6


More at the RSS 6 Home Page