Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix for http://core.trac.wordpress.org/ticket/16642

Signed-off-by: Thomas Scholz <info@toscho.de>
  • Loading branch information...
commit 48adba0e8dd9b6467a89c6c63cdc62bf170bab02 1 parent 125d792
Thomas Scholz authored February 25, 2011

Showing 1 changed file with 15 additions and 12 deletions. Show diff stats Hide diff stats

  1. 27  germanix_url.php
27  germanix_url.php
@@ -25,20 +25,18 @@
25 25
 	  Props: Sergey Biryukov · http://sergeybiryukov.ru/
26 26
 v 0.7
27 27
 	* Added support for Turkish
  28
+
  29
+v 0.8
  30
+	* Fix for http://core.trac.wordpress.org/ticket/16642
28 31
 */
29 32
 
30 33
 if ( is_admin() || ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) )
31 34
 {
32  
-	remove_filter('sanitize_title', 'sanitize_title_with_dashes');
33  
-	if ( ! empty ( $_POST )
34  
-		|| ! empty ( $_GET['action'] ) && $_GET['action'] == 'edit'
35  
-		|| defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST
36  
-	)
37  
-	{
38  
-		add_filter('sanitize_title',
39  
-			array ( 'Germanizer', 'sanitize_title_filter' ), 10, 1);
40  
-	}
41  
-		#array ( 'Germanizer', 'sanitize_filename_filter' ), 10, 1);
  35
+	remove_filter( 'sanitize_title', 'sanitize_title_with_dashes', 11 );
  36
+
  37
+	add_filter('sanitize_title',
  38
+			array ( 'Germanizer', 'sanitize_title_filter' ), 10, 2);
  39
+
42 40
 	// »häßliches-bild.jpg => haessliches-bild.jpg
43 41
 	add_filter('sanitize_file_name',
44 42
 		array ( 'Germanizer', 'sanitize_filename_filter' ), 10, 1);
@@ -69,12 +67,17 @@ static function sanitize_filename_filter($filename)
69 67
 	 * Fixes URI slugs.
70 68
 	 *
71 69
 	 * @param  string $title
  70
+	 * @param  string $raw_title
72 71
 	 * @return string
73 72
 	 */
74  
-	static function sanitize_title_filter($title)
  73
+	static function sanitize_title_filter($title, $raw_title = NULL)
75 74
 	{
  75
+		if ( ! is_null( $raw_title ) )
  76
+		{
  77
+			$title = $raw_title;
  78
+		}
76 79
 		$title = self::sanitize_filename_filter( $title );
77  
-		return $title;
  80
+		#return $title;
78 81
 		return str_replace('.', '-', $title);
79 82
 	}
80 83
 

0 notes on commit 48adba0

Please sign in to comment.
Something went wrong with that request. Please try again.