https://www.icyphoenix.com/viewtopic.php?f=26&t=1010&p=8060#p8060
-----------------------------------
lefty74
Thu 25 Jan, 2007 22:23

Re: "Could Not Insert New Entry"
-----------------------------------
Hi, I think this problem is rather related to using apostrophe's in the title and not htaccess.

The fix for this is below:

[code]	
open album_upload.php

FIND
$pic_title = str_replace("'", "''", htmlspecialchars(trim($_POST['pic_title'])));

$pic_desc = str_replace("'", "''", htmlspecialchars(substr(trim($_POST['pic_desc']), 0, album_config['desc_length'])));

$pic_username = (!$userdata['session_logged_in']) ? substr(str_replace("'", "''", htmlspecialchars(trim($_POST['pic_username']))), 0, 32) : str_replace("'", "''", $userdata['username']);


REPLACE WITH:

$pic_title = addslashes(str_replace("'", "''", htmlspecialchars(trim($_POST['pic_title']))));

	$pic_desc = addslashes(str_replace("'", "''", htmlspecialchars(substr(trim($_POST['pic_desc']), 0, $album_config['desc_length']))));

	$pic_username = (!$userdata['session_logged_in']) ? addslashes(substr(str_replace("'", "''", htmlspecialchars(trim($_POST['pic_username']))), 0, 32))  addslashes(str_replace("'", "''", $userdata['username']));[/code]


SOURCE:
[quote]-----------------------------------
Mighty Gorgon
Sun 24 Dec, 2006 00:25

Re: Fix For Problem With Apostrophe's In Description
-----------------------------------
You should not change that replacement, because is needed to correctly parse text in POST fields.

Use ADDSLASHES in front of it instead.

[code]	$pic_title = addslashes(str_replace("'", "''", htmlspecialchars(trim($_POST['pic_title']))));

	$pic_desc = addslashes(str_replace("'", "''", htmlspecialchars(substr(trim($_POST['pic_desc']), 0, $album_config['desc_length']))));

	$pic_username = (!$userdata['session_logged_in']) ? addslashes(substr(str_replace("'", "''", htmlspecialchars(trim($_POST['pic_username']))), 0, 32))  addslashes(str_replace("'", "''", $userdata['username']));[/code]

This should do the trick.

Let me know.


[/quote]


