20) $language = substr($language, 0, 20); $language = stripslashes($language); $language = strip_tags($language); $language = htmlspecialchars($language, ENT_QUOTES); } else { $language = "Plain Text"; } # Add a description if available if (isset($_POST['desc']) && "" != ($dtemp = rtrim($_POST['desc']))) { $desc = stripslashes($dtemp); if (strlen($desc) > 80) { $desc = substr($desc, 0, 76); $desc .= " ..."; } $desc = strip_tags($desc); $desc = htmlspecialchars($desc, ENT_QUOTES); if ("" == $desc) $desc = "No description"; } else $desc = "No description"; if (get_magic_quotes_gpc()) $text = stripslashes($text); $finalText = PastifyText($text, $language, $desc); $url = CreatePage($finalText); # Note: this function was pretty specific to my implementation. It stored # paste metadata about the language used, description, and URL, as well as # a timestamp (but the raw pastes were never preserved - they always expired # as promised after 24 hours) #add_to_db($desc, $language, $url); Header("Location: $url"); } else { header("Location: " . $_SERVER['HTTP_REFERER']); exit; } ?>