Invalid Characters breaking Validation
-
Is there a simple function or something I can use on a particular line to strip an invalid character so my photo site (heavily under development) validates? Here’s the skinny:
I’m messing about with Pictorialis (first version, not second). When I post digital photos that have EXIF data, it seems as though my camera, a Canon Powershot S1 IS, spits out an invalid character at the end of the camera name. It looks like a little box in the “edit post” screen in WordPress, and the XHTML validator says, “non SGML character number 0”
That is the ONLY thing breaking my validation. I COULD go in and edit it each time I post a new photo, but that sort of defeats the purpose.
Here’s the pertinent PHP in post.php:
if ($exif['IFD0']['Model']!='') {
$exifInfo = 'Camera: '.$exif['IFD0']['Model'].' | '.'Aperture: '.$exif['SubIFD']['FNumber'].' | ';
$exifInfo .= 'Shutter: '.$exif['SubIFD']['ExposureTime'].' | '.'Focal Length: '.$exif['SubIFD']['FocalLength'];
//print_r($exif);
//echo $exifInfo;
$_POST['metakeyselect'] = 'exifdata';
$_POST['metavalue'] = $exifInfo;
}
And the PHP from index.php that displays the info:
<?php
$metakeys = has_meta($post->ID);
//print_r($metakeys);
echo $metakeys[0]['meta_value'];
?>
Is there a really quick easy fix to this? Thanks in advance.
- The topic ‘Invalid Characters breaking Validation’ is closed to new replies.