Changeset 163
- Timestamp:
- 17/01/06 15:52:17 (3 years ago)
- Files:
-
- admin.lib.php (modified) (3 diffs)
- blog.lib.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
admin.lib.php
r162 r163 233 233 if (!$this->error) { 234 234 //first we make our short subject 235 $shortsubject = $this->blog->makeCleanString($subject );235 $shortsubject = $this->blog->makeCleanString($subject,true); 236 236 //need to check if there are any short titles like this one already 237 237 $sql = db_query("SELECT shortsubject FROM entries WHERE user_id = {$this->id} AND shortsubject ~ '{$shortsubject}(_[0-9]{1,3}$|$)' ORDER BY char_length(shortsubject) DESC, shortsubject DESC LIMIT 1;"); … … 354 354 } 355 355 } 356 356 /* currently not used.. if we dont want to bring back the delete link in printEntry from blog.lib we can get rid of this entirely 357 357 358 //delete an entry 358 359 function deleteEntry($shortSubject) … … 376 377 } 377 378 } 378 379 */ 379 380 //update settings 380 381 function updateSettings() blog.lib.php
r162 r163 314 314 315 315 //takes a string and strips it, making it safe to put in a URL 316 function makeCleanString($string) 317 { 316 function makeCleanString($string,$externalSource=false) 317 { 318 //externalSource meaning directly inputed by a user, in most cases this should be false.. appart from starting a new post 318 319 $string = strtolower($string); 319 320 $string = preg_replace("/[^a-z0-9\- _]/i", "", $string); 320 321 $string = str_replace(" ", "-",trim($string)); 321 $string = str_replace("_", "-",$string); 322 if ($externalSource) { 323 $string = str_replace("_", "-",$string); 324 } 322 325 $string = urlencode($string); 323 326 return $string;
